bulk resetting Active Directory passwords

Over the last few years, I have found myself in need of various scripts to handle the bulk resetting of passwords for users in Active Directory. This post contains the various scripts I have used to do this most mundane of tasks,

Method 1: Reset all users in an OU to the same password

This is by far the simplest method. Not overly useful, as there’s not usually a need for the same password on a whole OU of accounts! It is a simple DSQUERY piped to a DSMOD. It works in a command prompt.

Method 2: Reset all users in an OU to a random password

This script uses PowerShell to randomly select a word from a CSV file, appends a number and then sets the user account to that password and notes it in an output CSV file. The word list is a single column spreadsheet of words, with a column header “Name”.

Method 3: Reset all users in a group to the same password

This script does the same as method 1, but aimed at a specific Active Directory Group instead of an OU. Again, limited usefulness for most people, as setting everyone to the same password has limited use if you’re being secure.

Method 4: Resetting all users in a group to a random password

A mix of methods 2 and 3.

localzuk Written by:

Be First to Comment

Leave a Reply

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