Correct Way to Rename an Active Directory Domain Controller
If you rename your DC by renaming a Domain Controller in the
normal way you would rename a computer (using the System > Rename this PC
gui), you didn’t do it right and your metadata is likely irreversibly damaged.
However, I have seen success in this situation when multiple
DC’s exist by demoting a re-promoting the DC. If only a single DC exists I
would say its maybe a good idea to follow the below guide as it may get your
out of the proverbial but probably not recommended and you may have to rely on
backups.
Step 1: Getting ready.
Open a command prompt. (Windows key+r (run) + cmd)
Step 2: Adding an alternate computer name.
SYNTAX : netdom computername <currentDC FQDN>
/add:<newDCName FQDN>
In the command prompt, type (minus quotes) “netdom computername
wrongname.domain.local /add:server.domain.local“
This should return with “Added (NAME) as an alternate name
for the computer. The command completed successfully.“
renaming a domain
controller – adding the new name
Step 3: Make the new name the primary.
SYNTAX: netdom computername <currentDC FQDN>
/makeprimary:<newDCName FQDN>
Type netdom computername wrongname.domain.local
/makeprimary:server.domain.local
IMPORTANT: This command will return successful, and warn you
that you need to reboot immediately, as it may not authenticate logons (very
important if only DC in forest)
renaming a domain
controller – make the new name primary
Step 4: Reboot the server.
Pick your poison. I like “shutdown /r /t 0” in the cmd.
Step 5: Check new server name.
Go to system properties and confirm new computer name.
renaming a domain
controller – enumerating all the hostnames
Step 6: Remove old hostname.
SYNTAX: netdom computername <newDCName FQDN>
/remove:<oldDCName FQDN>
(remember, in a command prompt)
Type “netdom computername server.domain.local
/remove:wrongname.domain.local“
Command should return successfully.
renaming a domain
controller – removing the old name
Step 7:
in cmd, run a “dcdiag” to make sure everything is AOK.
Step 8: Clean up.
If you use logon scripts, remember to update the UNC paths
with the new server name.
Comments