[Webinar] Streamline your web hosting managementRegister Today

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 854
  • Last Modified:

Change Administrator Account on Multiple Computers

I need to rename and change the password for the local administrator account on my Window XP Pro machines.  Is there a script of utility that I can use to accomplish this.  Any help is appreciated.

Thanks in advance
1 Solution
If you are in an active directory domain you can use a machine group policy to accomplish this. If you need to apply it only to specific machines you can create/move them into a specific OU   OR create a security group, add those machines, then specify the GPO to only allow that security group to read the GPO.
hope that helps,
changing the password can be done with a machine startup script via the same GPO.
net user <newadminname> <newpassword>
GilardiCoAuthor Commented:
This works good to change the password, however I need to also rename the administrator account.

Check the discussion here: http://www.mcse.ms/message1188502.html
The 2nd script can be used to change the local admin account name to random 15 characters...
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

GilardiCoAuthor Commented:
That should work, I just need to change it to a specific name.
' This code renames the local administrator account.
strComputer = "."
strNewName = "<NewUserName>"  ' e.g. mike
' ------ END CONFIGURATION ---------

set objComputer = GetObject("WinNT://" & strComputer)
set objUser = GetObject("WinNT://" & strComputer & _
set objNewUser = objComputer.MoveHere(objUser.ADsPath,strNewName)
WScript.Echo "Successfully renamed account to: " & strNewName

Push this out as a startup script...
GilardiCoAuthor Commented:
That worked, thanks for the help.
Glad that helped. Thank you.
GilardiCoAuthor Commented:
Hello there,

Your script works great, however if the Administrator account is already renamed then it comes up with an error.  Anyway to build in a if then type situation so if no Administrator account exists then do not run the rest of the script?

Once again any help is appreciated.
It might be better to ask a new question in the vbscript TA - there are some really good Experts in there...
Someone should be able to help quite easily.
After all - PSM's are supposed to ask one question "per question"...
Feroz AhmedSenior Network EngineerCommented:
Right click on MyComputer select Manage and select Local Users and Groups and select the Administrator Account and right clik onto it and rename Administrator Account and once you are done with Renaming Administrator Account you can reset Password in the same way and in this manner you can change administrator account as well as reset password.

Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now