Task: change the computer name (hostname) on Windows XP, Vista, or 7, as well as on the server editions Server 2003 or 2008. This method does not work for domain controllers!
First, we need the netdom utility, which is part of the "Windows Server 2003 Administration Tools Pack". You can get the pack itself here: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=c16ae515-c8f4-47ef-a1e4-a8dcbacff8e3
In Windows Server 2008 this utility is included out of the box and nothing extra needs to be installed. However, this does not apply to Windows 7.
Changing the computer name
C:\> netdom renamecomputer COMPUTERNAME /newname:NEWNAME /userd:MYDOMAIN\DomainAdminUser passwordd:* /usero:COMPUTERNAME\Administrator /passwordo:* /reboot
Here
- COMPUTERNAME : The computer's current name
- NEWNAME : The machine's new name
- userd: ... : The domain administrator username under which the rename operation will be performed
- passwordd: * : Indicates that the domain administrator password should be requested interactively. You can enter the password here instead of the asterisk - in which case you won't be prompted
- usero: ... : The username of the local administrator on the computer you're going to work with. You can use the same domain admin name if it has the appropriate rights on the computer.
- passwordo: * : same as for the domain password
- /reboot : Indicates that the remote machine should be rebooted after the name change. This is required, since otherwise the computer name won't actually be changed on the machine
You can issue the command from any computer that has the netdom utility. For example, from the domain controller itself.
Comments