We help IT Professionals succeed at work.

Need batch file to change local administrator password

jimbecher
jimbecher asked
on
I have a domain with about 120 XP Professional computers. I am trying to find a batch file using the net command to change the local administrator password on all the computers. Something I can put in the login script.
Comment
Watch Question

Assistant Vice President\Network Manager
Commented:
Why not use Group Policy?

Start the Group Policy snap-in, expand Computer Configuration, expand Preferences, click Control Panel, and then right-click Local Users and Groups. From the menu select New - Local User.  Select Update as the action, type Administrator into the User name text box, then type the new password into the Password text box, confirming the password in Confirm Password text box. Press OK.

This is if the local administrator account is named "Administrator"

Author

Commented:
I guess I needed to specify a little further. It is a 2003 AD. I do not see those options in a 2003 AD. I guess you need a 2008 AD?
Commented:
The command is this:
net user administrator password

This will only work as a login script if the user logging in has admin rights. Also, if you put this in a login script, somebody could find it and see what the local admin password is because login scripts are plain text and everyone can read them if they know where to look.

You could use something that you run from your computer and changes the password on all the remote computers. Something like pspasswd which is part of the SysInternals suite that is now maintained by Microsoft.

You could also use an application like this: http://www.jdhitsolutions.com/pwdman/index.htm
Provide it with a list of the computers and it will do the rest.

Hope this helps.
Steven CarnahanAssistant Vice President\Network Manager

Commented:
Okay, you only need a 1 line batch file that has the following:

NET USER Administrator <password>

Again the user name must be Administrator.  This should be included in the Startup script and not the logon script because it needs to run with admin privelges.

CAUTION: The password is plain text this way.  

Author

Commented:
Thanks guys but Sysinternals came through again with pspasswd.exe :)

Commented:
Glad we could help.
Steven CarnahanAssistant Vice President\Network Manager

Commented:
Glad to be of assistance.  sysinternals is a great tool to have.  Glad junior15 remembered to mention it.  :)
i have unable to change local admin password because password field is gray out not changeable kindly give me solution
Steven CarnahanAssistant Vice President\Network Manager

Commented:
If it is grayed out it means that the account you are using does not have administrator privileges. It needs to be in the local computers Administrator group.