move the default variable to a more visible position
This commit is contained in:
parent
e782225e8d
commit
5e49ee7a85
|
@ -9,12 +9,14 @@ Catch
|
||||||
Break
|
Break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#Specify your default password here
|
||||||
|
$default_password = 'default-password'
|
||||||
|
|
||||||
function Reset-Password
|
function Reset-Password
|
||||||
{
|
{
|
||||||
Try
|
Try
|
||||||
{
|
{
|
||||||
$username = Read-Host 'Please enter a user name'
|
$username = Read-Host 'Please enter a user name'
|
||||||
$default_password = 'default-password'
|
|
||||||
Unlock-ADAccount -Identity $username
|
Unlock-ADAccount -Identity $username
|
||||||
Set-ADAccountPassword -Identity $username -Reset -NewPassword (
|
Set-ADAccountPassword -Identity $username -Reset -NewPassword (
|
||||||
ConvertTo-SecureString -AsPlainText $default_password -Force
|
ConvertTo-SecureString -AsPlainText $default_password -Force
|
||||||
|
|
Reference in New Issue