How to change local admin passwords remotely with a script
Systems administrators that manage local administrative accounts on multiple computers regularly need to change the account password as part of standard security practices. PsPasswd is a tool that lets you change an account password on the local or remote systems, enabling administrators to create batch files that run PsPasswd against the computers they manage in order to perform a mass change of the administrator password.
Use the steps below to build the tool.
Remotely change local administrator passwords.
Step #1
Download the pspasswd tool from Microsoft.
Go to: https://learn.microsoft.com/en-us/sysinternals/downloads/pspasswd
Step #2
Copy the pspasswd.exe to the:
c:\windows\system32\
directory on your PC or server.
Step #3
Create a file called “Machinelist.txt” with PC names you wish to change the local admin passwords on; one PC per line.
Step #4
Create a batch file with code similar to this:
pspasswd.exe @machinelist.txt -u domain\administrator -p domainpassword administrator newpassword
echo “Complete”
pause
Step #5
Edit the batch file with the correct credentials and the new password information.
Step #6
Make sure the machines are online and then run the script. You need to use an account with domain administrator rights for the –u and –p parameters in order for this to run correctly.
This is a very Quick, Simple, Effective method to manage local administrator passwords remotely.
PsPasswd uses the Windows password reset APIs, so it does not send passwords over the network in the clear.
Felix_da_CAT5
July 17, 2012
Well this might come in handy! - thanks
SnifferSir
October 5, 2012
Quite useful if you have several PC’s to change passwords for.