Bulk password resetting

In an effort to simplify bulk password resets. With a provided CSV of usernames with a “User” heading the below should easily reset their passwords in bulk and force them to pick a new password the next time they log onto a computer.

Import-Module ActiveDirectory
$User = Import-CSV "MyUsers.csv"
#Reset their password to a known common password
$User | Foreach {Get-ADUser -Identity $_.User | Set-ADAccountPassword -Reset -NewPassword (ConvertTo-SecureString -AsPlainText "Some_Random_Password_12345" –Force)}
#Force changing of the password at next login
$User | Foreach {Get-ADUser -Identity $_.User | Set-ADUser -Enable $True -ChangePasswordAtLogon $True}

Leave a comment

Your email address will not be published. Required fields are marked *