Link to home
Start Free TrialLog in
Avatar of Gerald_Tipler
Gerald_TiplerFlag for United States of America

asked on

Automate change of multiple local user passwords on a single server

We recently setup approx. 70 local user accounts on a server for our vendors to access. All the users are part of a local group. As part of our company policy the passwords need to be changed every 60 days. We would like to create a script or batch file to change the passwords on each of these accounts. The passwords should be pulled from a pre-generated file, created by Quicky Password Generator, as each vendor will have a different password. I have attached an example of the generated file. Any help or direction is appreciated.
qpwords.txt
Avatar of a_b
a_b

You can do this from the command prompt. To change the password of a user from the command prompt, go to Run > cmd.  Command prompt will open. Use the following commands to change the password:
net user username password /domain

You can write a batch file that takes as input the contents of the generator file.
The code to change a password is pretty easy:
Set objUser = GetObject("WinNT://server01/Pre2KNamer")
objUser.SetPassword("i5A2sj*!")

Probably the easiest way to change their passwords would be to use a "net localgroup vendorgroupname >vendornames.txt" to export the list of hte vendors you have to a txt file. Next, clean up the text file because net localgroup creates some extra info.  Lastly, use another piece of vbscript to read the vendor file and the password file and change passwords.



ASKER CERTIFIED SOLUTION
Avatar of Shift-3
Shift-3
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial