Re: Renameuser Utility
fyi, our next beta should automate this process if you don't want to write a script. We are adding Dynamic WMI Method Execution in the next update, so that you can run pretty much any WMI method on multiple instances or computers.
To join the beta group, send a blank email to [email protected]
Announcement
Collapse
No announcement yet.
Renameuser Utility
Collapse
X
-
Guest repliedRe: Renameuser Utility
This VBS code should work. The frirst block uses a computer name of "." to can access to soem local WMI data, including the actual name of the computer, which the later portion of the script requires to renew an account called Admin to NewAdmin.
strComputer1 = "."
Set objWMIService = GetObject("winmgmts:\" & strComputer1 & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * From Win32_ComputerSystem")
For Each objItem in colItems
strComputer = objItem.Name
Next
Set objWMIService = GetObject("winmgmts:\" & strComputer & "\root\cimv2")
Set colAccounts = objWMIService.ExecQuery _
("Select * From Win32_UserAccount Where LocalAccount = True And Name = 'Admin'")
For Each objAccount in colAccounts
objAccount.Rename "NewAdmin"
Next
Leave a comment:
-
Re: Renameuser Utility
For the computer name, can you enter %computername% ? This should be always defined.
Leave a comment:
-
Renameuser Utility
Hey Everyone,
I have a script that runs automatically when I build a new PC. The problem I run into is that I need to rename the Administrator account and Guest accounts. Being lazy, I don't want to manually change it on every PC, but since I won't know the "name" of the PC, is there a way to have the Renameuser utility work automatically on just the local PC regardless of the name?
Thanks in advance,
-JKTags: None
Leave a comment: