Download the Tom's Hardware App from the App Store
The reference for current tech news
Yes No
Ads
Tom's Hardware > Forum > Windows XP > General Discussion > change local admin password

change local admin password

Forum Windows XP : General Discussion change local admin password

Word :    Username :           
 
- 0 +

Archived from groups: microsoft.public.windowsxp.security_admin (More info?)

 

I want to change the local admin password on all the computers in our
company. I remember there is a tool to do it in Windows 2000 (Resource
Kit?). Can someone tell me how I can do it?

Reply to tiffany
Register or log in to remove.

Archived from groups: microsoft.public.windowsxp.security_admin (More info?)

 

Tiffany wrote:

> I want to change the local admin password on all the computers
> in our company. I remember there is a tool to do it in Windows
> 2000 (Resource Kit?). Can someone tell me how I can do it?
Hi,

If the computers are in an Active Directory domain:

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.

Here is a VBScript that does the job (it will find the builtin
administrator account regardless of it's name):

'--------------------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<----------------------


--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/s [...] fault.mspx

Reply to Anonymous
Tom's Hardware > Forum > Windows XP > General Discussion > change local admin password
Go to:

There are 2157 identified and unidentified users. To see the list of identified users, Click here.

Please mind

You are about to answer a thread that has been inactive for more than 6 months.
If you still wish to proceed, please ensure that your posting is original and does not duplicate or overlap any prior responses to this thread.

Add a reply Cancel
  • Ask the community now
  • Publish
Ad
Ads
Latest best answer
Microsoft Updates - In Triplicate !
By Hawkeye22, 1 day ago:

They won't show up in add/remove programs because they were superceded by a different...

Best offers
They won a badge
Join us in greeting them
Top experts