• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

rename local user account

DarkTXKnight

Senior member
I have a list of 200 mahcines that I would like to rename the local administrator account on. I wanted to know how I can have the batch file read from a list of machine names in order ro rename appropriately. For instance

Machine 12345 should have the account renamed to "admin12345"
Machine 12344 should have the account renamed to "admin12344"
and so on.

I want to have a text list of the machines, but I just dont know what I would put in the batch files for variables.

Any help is appreciated
 
You can rename local account using VB.

strComputer = "."

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colAccounts = objWMIService.ExecQuery _
("Select * From Win32_UserAccount Where LocalAccount = True And Name = 'Administrator'")

For Each objAccount in colAccounts
objAccount.Rename "NotAdministrator"
Next
 
I see where this is going, but I am not sure that I see the part where "nonadministrator" will be appended with part of the servername.will be "nonadministrator xxx"
 
Back
Top