Akash Bahl

All projects

Active Directory lab

A scripted build, then a Server 2016 to 2025 migration

  • Finished October 2026
  • 3 VMs on one laptop

I built an Active Directory domain from PowerShell scripts on Windows Server 2016, then migrated it side by side to Server 2025. After each stage I ran a check and only carried on once it passed.

Everything I claim in the repo links to a screenshot or a PowerShell transcript.

View on GitHub

Build
PowerShell, rebuilt from the repo
Migrate
Side by side, all five FSMO roles
Verify
repadmin · dcdiag · scream test
Schema
87 to 91, forest at Windows2025
Log
11 problems, each with root cause and proof
Host
3 VMs on a 16 GB laptop, VMware Workstation
Lab topology after the migration DC01 on Server 2016 handed all five FSMO roles to DC02 on Server 2025 and was demoted. CLIENT01 on Windows 11 logs on and gets Group Policy from DC02. All three sit on an isolated host-only network. DC01 Server 2016 demoted DC02 Server 2025 5 FSMO roles CLIENT01 Windows 11 logon + GPO 10.1.10.0/24 host-only, no internet

Why I did it this way

A side-by-side migration

An in-place upgrade would have been quicker. I went side by side so the old domain controller stayed up as a fallback until the new one had passed the replication checks, the role transfer and the scream test.

Snapshots of both servers together

Once two domain controllers are replicating, reverting just one of them to an older snapshot causes a USN rollback, which silently breaks replication. So from the point DC02 was promoted, I shut both down and snapshotted them as a pair.

How I know it worked

The migration had twelve steps. These are four of them, with the screenshot for each.

Step 4 of 12

Replication was healthy in both directions

Before moving any roles I ran repadmin. Both domain controllers showed 0 failures out of 5, as a source and as a destination.

PS> repadmin /replsummary
repadmin /replsummary output on DC02: DC01 and DC02 each show 0 fails out of 5 as source and as destination
evidence/06-replsummary.png View on GitHub

Step 8 of 12

All five FSMO roles moved to DC02

I checked who held the roles, moved all five with one command, then checked again.

PS> netdom query fsmo
PowerShell on DC02: netdom query fsmo lists all five roles on DC01, the move command runs, and a second query lists all five roles on DC02
evidence/09-fsmo-before-and-after.png View on GitHub

Step 9 of 12

Scream test with DC01 switched off

With the old domain controller powered off, a domain user could still log on at the client, and Group Policy came from DC02.

PS> gpresult /r
gpresult /r on CLIENT01 for user areyes, with the line Group Policy was applied from DC02.deadeye5457.com highlighted
evidence/10-client-on-dc02.png View on GitHub

Step 11 of 12

Domain and forest raised to Windows2025

This one can't be undone, so I left it until DC01 was demoted and DC02 had already come through a crash.

PS> Get-ADDomain | Format-Table DNSRoot, DomainMode
Get-ADDomain shows DomainMode Windows2025Domain and Get-ADForest shows ForestMode Windows2025Forest for deadeye5457.com
evidence/12-funclevel-raised.png View on GitHub

All twelve steps are in the README

What went wrong

Three of the eleven problems I hit.

  • DC02 blue-screened partway through

    What I saw
    dcdiag showed DC02 had rebooted after bugcheck 0x7A. Its second parameter, 0xc0000185, is an I/O device error, so I looked at the host's storage first.
    Cause
    The VMs are on an external SSD over USB. The drive dropped out for a moment and DC02's virtual disk disappeared mid-read.
    Fix
    I turned off USB power management for that port and plugged the SSD in directly. Before carrying on I checked the Directory Service log for database corruption events and found none.
  • dcdiag failed almost everything after the promotion

    What I saw
    DFSREvent, KccEvent, Services, SystemLog and ObjectsReplicated all failed on both domain controllers.
    Cause
    Most of it was noise from running in a VM. Two failures were real: replication hadn't caught up yet, and DC01's firewall was blocking remote event log reads.
    Fix
    I went through the failures one at a time and fixed the two real ones. Then I confirmed with repadmin, the SYSVOL share and event 4604 before touching the roles.
  • Demoting DC01 left stale DNS behind

    What I saw
    After the demotion, the _msdcs delegation still listed DC01 as its only name server.
    Cause
    That delegation was created with the forest on DC01, and promoting DC02 never updated it.
    Fix
    I added a delegation to DC02, removed DC01's record, and checked that no NS or SRV records still pointed at the old server.

All eleven are in the troubleshooting log

What I learned

PowerShell can do almost everything I used to click through, and it leaves a transcript behind as proof.

I also learned to check before any step I can't undo. I didn't move the roles until replication was proven, didn't demote DC01 until the scream test passed, and didn't raise the functional level until DC02 had come through a crash.

Going side by side caught a mistake of my own too. I built a Task Manager GPO by hand without noticing the script had already made one, so the HR OU had two GPOs doing the same job until a link check caught it.

Tools: Active Directory Domain Services, DNS, Group Policy, repadmin, dcdiag, Windows Server Backup, PowerShell, VMware Workstation.