Gerald_Tipler
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
qpwords.txt
The code to change a password is pretty easy:
Set objUser = GetObject("WinNT://server0 1/Pre2KNam er")
objUser.SetPassword("i5A2s j*!")
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.
Set objUser = GetObject("WinNT://server0
objUser.SetPassword("i5A2s
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
net user username password /domain
You can write a batch file that takes as input the contents of the generator file.