Centrally Resetting Local Admin Password

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I recently deployed about 60 Windows XP Pro PCs on my Windows 2003 network.
I hired some temporary help to deploy these PCs. Now that the temporary help
is no longer working for me, I need to change the local Administrator
password on all these PCs to something that the temporary help personnel do
not know.

Is there a way that I can change the local Administrator account password
without visiting each PC on the network?

Thanks.

-Chad
 
RCHolmes said:
I recently deployed about 60 Windows XP Pro PCs on my Windows 2003
network.
I hired some temporary help to deploy these PCs. Now that the
temporary help is no longer working for me, I need to change the
local Administrator password on all these PCs to something that the
temporary help personnel do not know.

Is there a way that I can change the local Administrator account
password without visiting each PC on the network?

Script..
Startup scripts are good for this.
PSEXEC could help with this as well.
 
RCHolmes said:
I recently deployed about 60 Windows XP Pro PCs on my Windows
2003 network. I hired some temporary help to deploy these PCs.
Now that the temporary help is no longer working for me, I
need to change the local Administrator password on all these
PCs to something that the temporary help personnel do not know.

Is there a way that I can change the local Administrator
account password without visiting each PC on the network?
Hi,

You could do it in a computer startup script (with a GPO) that runs
as part of the boot up process (before the user logs in). It runs
under the system context and has admin rights.

To avoid users being able to read the script where the password is
stored, grant read access only for the AD group "Domain Computers"
to the script file.


As long as the Administrator account name is "Administrator", this
batch file will set the password on the account:

'--------------------8<----------------------
@echo off
net.exe user administrator newpassword
'--------------------8<----------------------


As long as the Administrator account name is "Administrator", this
VBScript will set the password on the account:

'--------------------8<----------------------
sNewPassword = "testpassword"
Set oWshNet = CreateObject("WScript.Network")
sComputer = oWshNet.ComputerName

On Error Resume Next
Set oUser = GetObject("WinNT://" & sComputer & "/Administrator,user")
oUser.SetPassword sNewPassword
oUser.SetInfo
On Error Goto 0
'--------------------8<----------------------


If there is a chance that the name of the administrator is not
"Administrator" (e.g. the account is renamed, or you have some
non-English OS versions), you should use this version instead:

'--------------------8<----------------------
sNewPassword = "testpassword"

Set oWshNet = CreateObject("WScript.Network")
sComputer = oWshNet.ComputerName
sAdminName = GetAdministratorName

On Error Resume Next
Set oUser = GetObject("WinNT://" & sComputer & "/" & sAdminName & ",user")
oUser.SetPassword sNewPassword
oUser.SetInfo
On Error Goto 0


Function GetAdministratorName()

Dim sUserSID, oWshNetwork, oUserAccount

Set oWshNetwork = CreateObject("WScript.Network")
Set oUserAccounts = GetObject( _
"winmgmts://" & oWshNetwork.ComputerName & "/root/cimv2") _
.ExecQuery("Select Name, SID from Win32_UserAccount" _
& " WHERE Domain = '" & oWshNetwork.ComputerName & "'")

On Error Resume Next
For Each oUserAccount In oUserAccounts
If Left(oUserAccount.SID, 9) = "S-1-5-21-" And _
Right(oUserAccount.SID, 4) = "-500" Then
GetAdministratorName = oUserAccount.Name
Exit For
End if
Next
End Function
'--------------------8<----------------------
 
Back
Top