Re: Change Administrator Password on XP machines

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



A WMI script can be written to do this:

Set oWshNet = CreateObject("WScript.Network")

sUserName = "something"
' to get to the current username, use this instead
'sUserName = oWshNet.UserName


sComputerName = oWshNet.ComputerName
Set oUser = GetObject("WinNT://" & sComputerName & "/"& sUserName & ",user")


' to change password:
sOldPwd = "the oldpwd"
sNewPwd = "the newpwd"
oUser.ChangePassword(sOldPwd, sNewPwd)
oUser.Setinfo


' if you have admin rights and you want to set the password, do this instead:
sNewPwd = "the newpwd"
oUser.SetPassword(sNewPwd)
oUser.Setinfo



"Tom" <Tom@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:0CF4E71C-29A3-4DE9-86E0-E1B255FBD034@xxxxxxxxxxxxxxxx
Is there a command line that will change the computers administrator password?
Or is there another way I can force a password change on the computers
connected to the 2003 server? I need to change this password on 140 machines
or prevent someone from logging as the administrator to local machine and I
do not want to go to all 140 computers and change it.



.