PowerShell – Reset Passwords for All Accounts in a Specific OU

We had a requirement recently to reset all AD accounts in a particular OU to a specific password in a Dev environment.

Here’s a quick command to run in AD PowerShell to reset the passwords for all users in an OU to the same password.

*** Change bits in bold to match your OU and Desired Password ***

Get-ADUser -Filter * -SearchBase “OU=Service Accounts,DC=Domain,DC=com” | Set-ADAccountPassword -Reset -NewPasword (ConvertTo-SecureString -AsPlainText “Insert Password Here” -Force)

About the author