Skip to content

Instantly share code, notes, and snippets.

@terrytrent
Last active May 25, 2016 19:04
Show Gist options
  • Save terrytrent/912e1657940973d8606746689d91e3ab to your computer and use it in GitHub Desktop.
Save terrytrent/912e1657940973d8606746689d91e3ab to your computer and use it in GitHub Desktop.
$UsersToReset=Import-Csv "C:\pwreset.csv"
foreach($User in $UsersToReset)
{
$Password=($User.Password | ConvertTo-SecureString -AsPlainText -Force)
Set-ADAccountPassword -Identity $user.User -NewPassword $Password -Reset
Enable-ADAccount -Identity $User.User
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment