Tuesday, April 4, 2017

Renaming Server 2012 domain controller


In my test environment, I needed to change the hostname of the domain controller.  You can rename a domain controller using the netdom command.  It appears that you must first add a machine account based on the current machine account:

STEP 1: netdom computername /add:

so, in the powershell command prompt, type (with quotes) "netdom computername wrongname.domain.local /add:server.domain.local"



STEP 2: netdom computername /makeprimary:
so, we type netdom computername wrongname.domain.local /makeprimary:server.domain.local

Once the command completes successful, it will warn you that you need to reboot immediately, as it may not authenticate logons (very important if only DC in forest)


But, I kept getting this error message:
"Unable to add "VM1" as an alternate name for the computer.  The error is:
The specified domain either does not exist or could not be contacted.
The command failed to complete successfully."

Discovered from the following link, that in Windows Serve 2008 and Server 2012, that the netlogon share is not present after you install Active Directory services.

The NETLOGON share is not present after you install Active Directory Domain Services on a new full or read-only Windows Server 2008-based domain controller

Changed the registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters\SysvolReady
from 0 to 1.

Ran the commands successfully and the domain controller hostname was changed.

-Reggie

REFERENCES:
https://www.experts-exchange.com/questions/28188083/The-specified-domain-either-does-not-exist-or-could-not-be-contacted-error-message-in-Windows-Server-2012.html#a39336191

https://community.spiceworks.com/how_to/103538-properly-renaming-a-domain-controller-server-2012r2