Jump to content
EduGeek EdSec 2026 is on Tuesday in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Recommended Posts

Posted

I have an OU with 250 users in it. I need to changed their passwords as they have worked out the format we used to do them before. I have a script that will give them a password to logon and then they get prompted to input another password that only they know.

 

What i want to do is give them a password from a file, ie have a script that looks for their user name in OU against a csv file and then gives them a password associated with their name fromthe file.

 

Not sure if this makes sense but i am sure someone will get the jist of it.

Posted
If this is a one off then the quickest to do would be to do an export list of the OU from ADUC to a CSV and then use FOR /F NET USER to set the password.

 

 

Sorry to be a bit dumb but could you give me an example of this please?

Posted

ADUC has the option to export a list of the contents of an OU to a text file. You'll need to use View|Add/Remove columns to add the username column to the display.

 

The format of the file we such that the first line will contain the column/field heading. Load the CSV into Excel (other spreadsheet programs are availible) and produce an extra column for the passwords.

 

Now suppose that 4th field was the username and the 5th was the password then you can type the following at the command line.

 

FOR /F "skip=1 tokens=4,5 delims=," %a IN (userlist.csv)  DO NET USER %a %b

 

where userlist.csv is the file you exported from ADUC and added the passwords to. %a is the username and %b the dedicated password.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...