Skip to content

Instantly share code, notes, and snippets.

@Purp1eW0lf
Created February 15, 2022 23:24
Show Gist options
  • Save Purp1eW0lf/05fe2dbfd649ec01473c7593eb359504 to your computer and use it in GitHub Desktop.
Save Purp1eW0lf/05fe2dbfd649ec01473c7593eb359504 to your computer and use it in GitHub Desktop.
$user = "erochester" ;
$newPass = "[New-Password-Please]";
#Change password twice.
#First can be junk password, second time can be real new password
Set-ADAccountPassword -Identity $user -Reset -NewPassword (ConvertTo-SecureString -AsPlainText "6;wB3yj9cI8X" -Force) -verbose
Set-ADAccountPassword -Identity $user -Reset -NewPassword (ConvertTo-SecureString -AsPlainText "$newPass" -Force) -verbose
#If the machine is not connected to AD, or account is a local one use this instead
net user erochester "[New-Password-Please]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment