I am trying to rename my administrator account on a few machines in a test environment, but I am looking to add the system name to end of the name..
in this, it renames Administrator to jose.
But what I would like is:
joseSYSTEM1 (system1 is the name of the machine)
Is this possible? I can display the computer name, but I am not sure how to add that into this to make it do what I want.
thanks in advance.
- Cal
in this, it renames Administrator to jose.
But what I would like is:
joseSYSTEM1 (system1 is the name of the machine)
Is this possible? I can display the computer name, but I am not sure how to add that into this to make it do what I want.
Code:
strComputer = "."
strNewName = "jose"
set objComputer = GetObject("WinNT://" & strComputer)
set objUser = GetObject("WinNT://" & strComputer & _
"/Administrator,user")
set objNewUser = objComputer.MoveHere
(objUser.ADsPath,strNewName)
WScript.Echo "Woot! Renamed the account to: " & strNewName
thanks in advance.
- Cal