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.
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.
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?
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.
where userlist.csv is the file you exported from ADUC and added the passwords to. %a is the username and %b the dedicated password.Code:FOR /F "skip=1 tokens=4,5 delims=," %a IN (userlist.csv) DO NET USER %a %b
This was is certainly alot less complicated then if you did it in vbs.
There are currently 1 users browsing this thread. (0 members and 1 guests)