September 2003
Intermediate to advanced
624 pages
15h 49m
English
You want to rename a computer.
Log on to the compute r either directly or with a remote console application, such as Terminal Services.
Open the Control Panel and double-click on the System Applet.
Select the Computer Name tab and click the Change button.
Under Computer Name, type the new name of the computer and click OK until you are out of the System applet.
Reboot the machine.
> netdom renamecomputer <ComputerName> /NewName <NewComputerName> /UserD[RETURN] <DomainUserUPN> /PasswordD * /UserO <ComputerAdminUser> /PasswordO * /Reboot
' This code renames a computer in AD and on the host itself. ' ------ SCRIPT CONFIGURATION ------ strComputer = "<ComputerName>" e.g. joe-xp strNewComputer = "<NewComputerName>" e.g. joe-pc strDomainUser = "<DomainUserUPN>" e.g. administrator@rallencorp.com strDomainPasswd = "<DomainUserPasswd>" strLocalUser = "<ComputerAdminUser>" e.g. joe-xp\administrator strLocalPasswd = "<ComputerAdminPasswd>" ' ------ END CONFIGURATION --------- '########################### ' Connect to Computer '########################### set objWMILocator = CreateObject("WbemScripting.SWbemLocator") objWMILocator.Security_.AuthenticationLevel = 6 set objWMIComputer = objWMILocator.ConnectServer(strComputer, _ "root\cimv2", _ strLocalUser, _ strLocalPasswd) set objWMIComputerSystem = objWMIComputer.Get( _ "Win32_ComputerSystem.Name='" & _ strComputer & "'") '########################### ...