Replacing a Domain Controller: Adding a New DC and Transferring FSMO Roles

Replace an old domain controller smoothly: pre-checks, promoting the new DC, FSMO transfer, the PDC time source, redirecting DNS/DHCP and removing the old DC.
Technical summary
Technology
Active Directory Domain Services, FSMO, DFSR, W32Time, DNS, DHCP
Topic
Replacing a domain controller with a new one
Level
Intermediate–advanced
Prerequisites
  • Domain Admins and, if needed, Enterprise/Schema Admins rights
  • A current, verified system state backup
  • AD replication concepts
In this article8 sections

What causes trouble in a DC replacement is rarely the new server itself. Forgotten FSMO roles, a time source left on the old server, DNS addresses hard-coded into devices and changes made on top of already unhealthy replication are what break things. When the steps are taken in the right order, users don’t notice the change. The order below is for a typical single-forest, single-domain environment; it runs in sequence from the pre-checks to removing the old server.

Pre-replacement checks

If you add a new DC to an unhealthy directory, the problems are copied to the new server too. Before starting, run these checks and keep the output; the comparison after the replacement will be made against it:

repadmin /replsummary
repadmin /showrepl * /csv > C:\Temp\replication.csv
dcdiag /e /q
netdom query fsmo
dfsrmig /getglobalstate
  • There should be no failed replication or long “largest delta” in the repadmin /replsummary output.
  • dcdiag /e /q lists only errors; empty output is the goal.
  • netdom query fsmo shows which DC holds each of the five roles. Record it.
  • dfsrmig /getglobalstate should return “Eliminated.” If SYSVOL is still replicated with FRS, Windows Server 2019 and later can’t be promoted as a DC; first complete the move from FRS to DFSR. Old environments often get stuck on this blocker.

Also check the domain and forest functional levels (Get-ADDomain, Get-ADForest); verify in the Microsoft documentation the lowest functional level the new DC version supports. Then list what runs on the old DC besides the DC role: DHCP, a certificate authority (AD CS), file shares, printing, NPS, license services of old applications. The real surprises come from this list. A server with AD CS installed can’t be renamed and needs a separate migration plan. Before the replacement, verify that a system state backup was taken and can be restored; for details, see the Active Directory backup and restore article.

If privileged accounts and delegation are also to be reviewed along with directory health, consider the scope of an Active Directory security audit.

Promoting the new domain controller

Give the new server a static IP, point its primary DNS to an existing healthy DC, join the server to the domain and make sure it lands in the right AD site; if the subnet isn’t defined in Sites and Services, the server ends up in the wrong site. Then install the role and promote:

Install-WindowsFeature AD-Domain-Services -IncludeManagementTools

Install-ADDSDomainController -DomainName "contoso.local" -InstallDns `
  -SiteName "HQ" -Credential (Get-Credential CONTOSO\admin.user) `
  -SafeModeAdministratorPassword (Read-Host -AsSecureString "DSRM password")

On Windows Server 2012 and later, schema and domain preparation (adprep) is run automatically by the wizard when needed; the account used must be a member of Schema Admins and Enterprise Admins. The server restarts after promotion. Verify that the first replication has finished and SYSVOL is shared:

repadmin /showrepl DC02
net share | findstr /i "SYSVOL NETLOGON"
Get-ADDomainController -Identity DC02 | Select-Object Name, Site, IsGlobalCatalog

Event 4604 in the DFS Replication log shows that the initial SYSVOL synchronization has completed and the share is open. Don’t move on to FSMO transfer before you see this event. Rushing here costs a lot.

Transferring FSMO roles

Of the five FSMO roles, two are forest-level and three are domain-level:

Role Scope Impact if lost
Schema Master Forest Schema updates can’t be made
Domain Naming Master Forest Domains can’t be added or removed
PDC Emulator Domain Time, password change propagation and account lockout are affected
RID Master Domain New objects can’t be created when the RID pool runs out
Infrastructure Master Domain Updating cross-domain references stalls

While the role holder is online, always transfer. You can move all roles to the new DC with a single command; forest roles require Enterprise Admins and Schema Admins membership:

Move-ADDirectoryServerOperationMasterRole -Identity "DC02" `
  -OperationMasterRole SchemaMaster, DomainNamingMaster, PDCEmulator, RIDMaster, InfrastructureMaster

netdom query fsmo

The parameters are in the Move-ADDirectoryServerOperationMasterRole documentation. The command asks for confirmation for each role; -Confirm:$false can be used in a script. After the transfer, run netdom query fsmo on different DCs; all should show the same role holders. If they don’t, replication hasn’t caught up yet.

The time service and the PDC emulator

The PDC emulator of the forest root domain is the top of the domain time hierarchy. By default, Kerberos doesn’t accept a clock difference greater than five minutes; when the PDC role is moved, the time source configuration must be moved too. This is the step that is often skipped: the roles move to the new server, the external NTP setting stays on the old one. Define a reliable external source on the new PDC and return the old PDC to the hierarchy:

# On the new PDC emulator (DC02)
w32tm /config /manualpeerlist:"0.tr.pool.ntp.org,0x8 1.tr.pool.ntp.org,0x8" /syncfromflags:manual /reliable:yes /update
Restart-Service w32time
w32tm /resync /rediscover

# On the old PDC (DC01)
w32tm /config /syncfromflags:domhier /reliable:no /update
Restart-Service w32time

# Verification
w32tm /query /status
w32tm /monitor

Choose the NTP source according to your organization’s policy; for external NTP, UDP 123 must be open on the firewall. If the PDC is a virtual machine, the hypervisor’s guest time sync (the Time synchronization integration service in Hyper-V) can override the time source. If you see “VM IC Time Synchronization Provider” in the w32tm /query /source output, turn off this sync for the PDC.

Redirecting DNS, DHCP and client settings

Before shutting down the old DC, find everything in the server and system infrastructure that refers to it by address and point it to the new DC:

  • DHCP option 006: Update the DNS server list in the scopes: Set-DhcpServerv4OptionValue -ScopeId 10.10.10.0 -DnsServer 10.10.0.12,10.10.0.13.
  • Servers and devices with static IPs: Inventory the DNS client settings of servers, and the DNS, LDAP and NTP addresses on printers, scanners, firewalls and storage devices. Clients still coming to the old DC show up in its event logs and DNS query log. This list should be empty before shutdown day.
  • DNS client settings of the other DCs: No DC should point to the server being removed as its primary DNS.
  • Forwarders: Check that the new DC’s forwarder configuration is the same as the old one’s; the server-level forwarder setting isn’t replicated.

Details of the right setup on the DNS side are in the Active Directory DNS configuration article. If DHCP runs on the old DC, move the service together with lease information:

# On the old server
Export-DhcpServer -ComputerName DC01 -File C:\Temp\dhcp.xml -Leases
# On the new server
Import-DhcpServer -ComputerName DHCP02 -File C:\Temp\dhcp.xml -BackupPath C:\Temp\dhcpbak -Leases
Add-DhcpServerInDC -DnsName dhcp02.contoso.local -IPAddress 10.10.0.20
# After stopping the service on the old server
Remove-DhcpServerInDC -DnsName dc01.contoso.local -IPAddress 10.10.0.11

When moving DHCP, it makes sense to remove the single-server dependency too; for that, see the Windows Server DHCP failover article.

Removing the old DC and metadata cleanup

After the redirections are done, keep the old DC powered off for a few days instead of demoting it right away. If a dependency was missed, the phone rings during this time. Don’t let this period approach the tombstone lifetime (180 days by default in new forests). If no problems come up, power the server on and demote it properly:

Uninstall-ADDSDomainController -LocalAdministratorPassword (Read-Host -AsSecureString "Local administrator password")
# After the restart
Uninstall-WindowsFeature AD-Domain-Services -IncludeManagementTools

Demotion cleans up the server’s NTDS Settings object and DNS records itself. Then look for these leftovers:

  • An empty server object left under Sites and Services.
  • A records for the old address in DNS, the zones’ NS records and SRV records under _msdcs.
  • Zone transfer and notify lists in the DNS zones.

If the old DC can’t be demoted properly because it has failed, with the tools in Windows Server 2008 and later, deleting the computer object from the Domain Controllers OU in Active Directory Users and Computers starts metadata cleanup. Alternatively, the metadata cleanup command set in ntdsutil can be used.

When seize is needed

Seizing means forcibly taking the role when the role holder is permanently lost. The right conditions for using it:

  • The role-holding DC will never come online again because of hardware failure, a corrupted database or an irreversible event.
  • The role’s absence is really causing business impact. During short outages, the absence of most roles isn’t felt right away; a few hours without the RID Master usually causes no problem thanks to the RID pools the DCs hold. The absence of the PDC emulator, however, is noticed quickly because of time and account lockout behavior.
Move-ADDirectoryServerOperationMasterRole -Identity "DC02" `
  -OperationMasterRole PDCEmulator, RIDMaster, InfrastructureMaster -Force

-Force makes the role be taken by force (seize) when the old role holder can’t be reached; use it only after the conditions above have been verified. Never reconnect an old DC whose role was seized to the network. Especially for the RID Master and Schema Master, having two holders at the same time leads to duplicate identities and directory inconsistency. This server is reinstalled, metadata cleanup is done and, if needed, it is promoted as a DC from scratch. There’s no going back.

If the replacement is part of a broader version migration, see the Windows Server 2016 end of support migration plan article for planning. In environments with multiple sites or dependent roles such as AD CS, we can plan the steps together within infrastructure consulting.

Frequently asked questions

Does transferring FSMO roles affect users?

A proper transfer doesn’t interrupt user sessions; roles change hands within seconds. The real impact comes from changing DNS addresses and shutting down the old DC; do these steps in a planned window.

Does it make sense to give the new DC the old DC’s IP address?

If many devices have the DNS address entered manually, moving the IP to the new DC after the old DC is removed makes the job easier. In that case make sure the new DC re-registers its DNS records and that the A and NS records for the old address are cleaned up.

Can I use seize if the old DC is still running?

Don’t. If the role holder is online, transfer. Seize is only for cases where the role holder is permanently lost and will never connect to the network again.

Does the global catalog role need to be moved separately?

The global catalog isn’t an FSMO role. Install-ADDSDomainController makes the new DC a global catalog by default; in single-domain forests, having all DCs as GCs is the recommended setup.

Support

Contact us for support or a discovery session on this topic.

Contact form
[email protected]

Eretek System Support

Server installation, configuration, incident response and scheduled maintenance. Active Directory, virtualization and backup are managed with the same discipline.

Knowledge Center

Other articles