How to Use the Tool
How you launch the Set-LocalPassword tool depends on your Windows OSs and whether you have many or only a few computers. To use the Set-LocalPassword tool on a Windows 2003 or XP system that has many computers, log on to the domain using an account that has workstation administration rights, open a command-shell window, and enter the command to run the tool. For example, suppose your input file is C:\ computers.txt, the workstation administrator accounts are all named admin, and you want to set the account passwords to tw1nkl3. On a Windows 2003 or XP system, you'd execute the command
Set-LocalPassword
admin
Set-LocalPassword will prompt you to enter and confirm the new password, then begin changing the passwords. When a password change succeeds, the output shows the machine name followed by the word SUCCESS. If you have a noncatastrophic failure, the script displays the machine name followed by the word FAILURE and a brief description of the cause. If you don't want to display the success messages, you can suppress them with the /Q switch to display only the machines that couldn't be updated and the possible reasons for the failures.
You can redirect the script's output to a file. Because the failures use the console's standard error stream, the redirection must specify the error stream, which has an ID of 2. The following command sends success messages to the console and redirects failure messages to the error.log file:
Set-LocalPassword
admin
error.log
If you want to change passwords on just a few machines, you can specify each machine name on the command line after the name of the account to change:
Set-LocalPassword admin
WS01 WS02 WS03 WS04
To use the Set-LocalPassword tool on a Win2K or NT 4.0 system on which the ADSI extensions are installed, you need to provide the password on the command line. Log on to the domain using an account that has workstation administration rights, open a command-shell window, and run the command
Set-LocalPassword
admin /P: tw1nkl3
Changing Local Administrator Passwords Made Easy
Organizations without centralized network infrastructures need a way to regularly change their local Administrator account passwords to avoid security vulnerabilities. The Set-LocalPassword tool lets those organizations easily change these important passwords, no matter whether their Windows networks are large or small.
Alex K.Angelopoulos (alexangelopoulos@ hotmail.com) is a senior network engineer who does IT consulting work in Indiana. He is an MCSE, an MCP+I, and an MVP.