Search The Web

Tuesday, February 25, 2014

Bulk Reset User Passwords with Powershell.

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)
Bulk Reset AD Passwords
Bulk Reset AD Passwords
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 
Check OU Membership With Powershell
Check OU Membership With Powershell
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
Import-Module ActiveDirectory
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