Bulk Reset User Passwords with Powershell.
On occasion, you need to bulk reset user passwords for an ou or group of users. This can easily be accomplished using Powershell and the following script.
Get-ADUser -Filter * -SearchScope Subtree -SearchBase "OU=Department,OU=Users,DC=corp,DC=company,DC=com" | Set-ADAccountPassword -Reset -NewPassword (ConvertTo-SecureString -AsPlainText "New Password Here" -Force)
Change the OU path to what you need it to be, and before you proceed you probably want to check the affected users with this script to ensure that you dont overwite something like the CEO or an admins password:
Get-ADUser -Filter * -SearchScope Subtree -SearchBase "OU=Department,OU=Users,DC=corp,DC=company,DC=com" | Ft Name
Again, just change the OU structure to what you need.
As a point of note, you run this, depending on what you ahve installed you may need to import the Active Directory Module for Powershell with
Import-Module ActiveDirectory
This article can be viewed on our sister site www.dizzyit.com at: http://wp.me/p1Zlmi-7k
No comments:
Post a Comment