Active Directory Series

🔁 Hands-On: Migrating From an Old DC to a New One — FSMO Transfer, Demotion, and Hostname Takeover in Practice

Introduction

This article is part of the Top 1% Series’ full article guide, and the fifteenth article in the Active Directory series — a hands-on capstone for the series as a whole. Reading Understanding FSMO (Operations Master) Roles, Understanding DC Health Checks, Reading dcdiag /v, Understanding Post-Migration AD Cleanup, and What’s the Difference Between sysdm.cpl and netdom computername? beforehand is strongly recommended.

Prerequisites

This article assumes you’re already familiar with nearly the entire AD DS series so far. In particular, the following are treated as prerequisites and not re-explained here:

Prerequisites for the Hands-On

Getting the Big Picture

The Overall Flow of Work

graph LR
    Step1["Step 1<br/>Build NEW-DC01<br/>as an additional DC"] --> Step2["Step 2<br/>Verify replication<br/>health"]
    Step2 --> Step3["Step 3<br/>Transfer FSMO<br/>to NEW-DC01"]
    Step3 --> Step4["Step 4<br/>Verify DNS/GC<br/>roles"]
    Step4 --> Step5["Step 5<br/>Formally demote<br/>OLD-DC01"]
    Step5 --> Step6["Step 6<br/>Verify post-demotion<br/>cleanup"]
    Step6 --> Step7["Step 7 (optional)<br/>Hand the old DC's<br/>name to NEW-DC01"]

This order matters for the reason touched on in Should All FSMO Roles Be Consolidated on One DC, or Spread Out? — the core principle of a safe migration is transferring FSMO (a transfer, not a seizure) while the current role holder (OLD-DC01) is still running normally. If you take the old DC down first, you’re forced into the much messier emergency option of a seizure.

Step 1: Build NEW-DC01 as an Additional DC

On NEW-DC01, open PowerShell as administrator and join it to the existing domain as an additional DC.

Install-WindowsFeature AD-Domain-Services -IncludeManagementTools

Install-ADDSDomainController `
    -DomainName "example.com" `
    -InstallDns `
    -Credential (Get-Credential "EXAMPLE\Administrator") `
    -SafeModeAdministratorPassword (ConvertTo-SecureString "P@ssw0rd-DSRM!" -AsPlainText -Force)

Once this completes, NEW-DC01 comes up as the second DC of example.com. By default, a newly promoted DC also gets the global catalog (GC) enabled automatically.

Step 2: Verify Replication Health

Using the commands covered in Understanding DC Health Checks and Reading dcdiag /v, always confirm that replication between the two DCs is functioning correctly before proceeding to the FSMO transfer.

# Run on both DCs, to confirm they recognize each other as replication partners
repadmin /showrepl

# Check NEW-DC01's own health
dcdiag /v

As covered in Emphasizing repadmin’s Subject (the Receiving Side), the output of repadmin /showrepl shows the replication state with the DC you ran it on as the receiving side — so run it on both OLD-DC01 and NEW-DC01 to confirm replication is healthy in both directions. Don’t proceed to the FSMO transfer until you’ve confirmed replication is healthy.

Step 3: Transfer the FSMO Roles to NEW-DC01

Once replication health is confirmed, transfer all five FSMO roles to NEW-DC01, running the command from either OLD-DC01 or NEW-DC01 (wherever the Active Directory module is available).

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

As covered in FSMO Transfer: Safely Moving a Role, this is the proper transfer procedure, performed while the current role holder (OLD-DC01) is still running normally. Running it prompts for confirmation for each role, so review the details as you proceed.

Once the transfer completes, always confirm the result:

netdom query fsmo

Confirm that all five roles have moved to NEW-DC01.

Step 4: Verify the DNS and GC Roles

FSMO only covers those five roles — the DNS server and global catalog are separate, independent roles from FSMO. As touched on in The Risk of a Single-DNS-Server Configuration, before decommissioning OLD-DC01, you need to confirm NEW-DC01 can handle DNS resolution and GC search on its own without any problem.

# Check whether NEW-DC01 holds the GC
Get-ADDomainController -Identity "NEW-DC01" | Select-Object IsGlobalCatalog

# Check that NEW-DC01's DNS server function responds correctly
nslookup example.com NEW-DC01.example.com

Step 5: Formally Demote OLD-DC01

Once everything above is confirmed, formally demote OLD-DC01 through the proper procedure.

Uninstall-ADDSDomainController `
    -DemoteOperationMasterRole `
    -Credential (Get-Credential "EXAMPLE\Administrator") `
    -LocalAdministratorPassword (ConvertTo-SecureString "P@ssw0rd-Local!" -AsPlainText -Force)

Including -DemoteOperationMasterRole activates the safety net covered in What Actually Happens if You Demote a DC Without Remembering to Transfer Its Roles First? — “if this DC still happens to hold any FSMO roles, automatically transfer them to another DC before demoting” (in this hands-on lab, since you already transferred everything in Step 3, nothing should actually get transferred here).

Step 6: Verify Post-Demotion Cleanup

Using the four consoles covered in Understanding Post-Migration AD Cleanup, confirm that all trace of OLD-DC01 has been fully removed.

  1. dsa.msc: Confirm OLD-DC01 no longer sits in the Domain Controllers OU, and has correctly moved to the Computers container (or been fully deleted).
  2. dssite.msc: Confirm OLD-DC01’s server object under Sites, and its NTDS Settings object underneath it, have been deleted.
  3. dnsmgmt.msc: Confirm OLD-DC01’s A record, and the SRV records and GUID-named CNAME record under the _msdcs zone, have been deleted.
  4. repadmin /replsummary: Confirm OLD-DC01’s name doesn’t show up anywhere as a replication partner.

With a graceful demotion, most of this gets cleaned up automatically. If any of it is still left behind, first check whether the demotion truly completed successfully (any errors left in the event log) before resorting to manually deleting it via adsiedit.msc.

Step 7 (Optional): Hand OLD-DC01’s Name Over to NEW-DC01

If internal systems or scripts have OLD-DC01’s name hardcoded, you can rename NEW-DC01 to OLD-DC01, following the procedure covered in What’s the Difference Between sysdm.cpl and netdom computername?.

# Register the current name as an alternate name
netdom computername NEW-DC01 /add:OLD-DC01

# Promote the registered alternate name to primary (NEW-DC01 becomes the alternate name at this point)
netdom computername NEW-DC01 /makeprimary:OLD-DC01

# A reboot is required for this to take effect
shutdown /r /t 0

If you do this, absolutely do not forget to first rename the actual, now-demoted OLD-DC01 machine (if you’re repurposing it for another use) to a distinct, unique name. As covered in A Real Case: A Hostname Collision After an AD Migration Broke Logons, skipping this step can lead to a serious authentication outage.

After rebooting, it’s worth confirming the secure channel is healthy under the new name (OLD-DC01) using Test-ComputerSecureChannel, covered in Understanding the Netlogon Service and the Secure Channel.

The View From the Top 1% Perspective

Exercise: Deliberately Triggering and Reading a dcdiag /v Warning

In Reading dcdiag /v, we covered how, in a real-world AD migration, it’s actually rare to see dcdiag /v come back with zero warnings at all. Here, let’s deliberately introduce a minor inconsistency and practice reading and interpreting the resulting warning.

Exercise: Deliberately delete a DNS record to make dcdiag's DNS test fail

Warning: only do this in a disposable, throwaway lab environment.

  1. Open dnsmgmt.msc and deliberately delete one of NEW-DC01’s GUID-named CNAME records under the _msdcs.example.com zone.
  2. On NEW-DC01, run dcdiag /v /test:DNS.
  3. Confirm that the item related to the record you deleted shows up as a FAIL or a warning in the DNS test. The output should indicate specifically which record couldn’t be found.
  4. From what’s displayed, try to explain in your own words “which zone, which type of record, and why it’s needed” — checking your answer against the role of GUID-based CNAME records covered in Understanding DNS Zones and Records.
  5. Once you’ve confirmed this, either manually restore the deleted record, or run ipconfig /registerdns and nltest /sc_reset:example.com to trigger automatic re-registration, and confirm dcdiag /v /test:DNS passes again.

The point of this exercise isn’t just “an error appeared” — it’s learning to work backward from the specific output to figure out which mechanism is actually broken. That’s exactly the skill that separates a confident, evidence-based response from a guess when you hit a real-world failure.

Common Errors and How to Handle Them

Cleaning Up the Lab Environment

To tear down this hands-on environment, run the following on the last remaining NEW-DC01 (or the renamed DC, if you completed Step 7), to remove the entire domain:

Uninstall-ADDSDomainController -LastDomainControllerInDomain -DemoteOperationMasterRole -Force

Summary

That’s all 15 articles in the Active Directory series. If you’d like to review the whole thing by ear during a commute or while doing chores, check out [Listen] The Active Directory Series, Fully Recapped.

References

Comments

Feel free to leave thoughts, questions, or corrections below (sign in with a GitHub account to comment or react).