Active Directory sites and replication

Once a company opens a second office, its DCs can’t all sit in one building any more. Active Directory replication between sites is what keeps every DC’s copy of the directory in step, and it tries to send as little traffic as it can over the slower links.

You’ll split the lab into two sites, HQ and Branch, give each one its subnets, move DC02 to the branch and join the two with a site link. Then you’ll watch and force replication with repadmin, break it twice, and see where read-only DCs fit in.

TimeYou needBy the end you can
About 75 minutesDC01, DC02 and CL01 from Phase 2Create sites, subnets and site links, move a DC between sites, read repadmin output, force replication, and diagnose RPC and site-mapping problems

What it is, in one line

Active Directory replication is the process that copies changes (new users, password resets, group changes) from the DC where they were made to every other DC, inside a site quickly and between sites on a schedule.

In Simple Words

Two school offices sharing one register

A school has two buildings, each with its own office and its own copy of the student register, and when a new student joins at one office the other office’s copy has to be updated too. Inside one building the secretaries shout the change across the room straight away. Between the buildings, someone walks over with the day’s changes every 15 minutes so nobody is running back and forth all day. AD works the same way, fast inside a site and on a schedule between sites, and sites are how AD knows which DCs are “in the same room”.

Engineer's View

Sites, KCC, USNs and RODCs

Sites and subnets: a site is a set of well-connected subnets. Subnet objects map client IP addresses to sites so clients can find DCs in their own site, and when more than one subnet matches, the most specific one wins. A DC belongs to whichever site its server object sits in.

Topology: the Knowledge Consistency Checker (KCC) on every DC builds the connection objects for you, as a ring inside a site and through a bridgehead DC between sites. Each site link has a cost (lower is preferred) and a replication interval, which defaults to 180 minutes and can go as low as 15.

How changes flow: inside a site, replication kicks off about 15 seconds after a change, while between sites it follows the link schedule and is compressed. Every DC tracks changes with update sequence numbers (USNs) and the up-to-dateness vector, so only new changes get sent. Account lockouts and some security changes replicate urgently, and password changes go to the PDC Emulator straight away.

RODCs: a read-only DC is meant for branches with weak physical security. It holds no passwords apart from the ones you allow it to cache (the Password Replication Policy), it accepts no changes, and local branch staff can manage it without Domain Admin rights.

How it works, step by step

Here’s how a change made at HQ reaches the branch:

Active Directory replication: a change travels from DC01 at HQ to DC02 in Branch

Inside HQ the change spreads in seconds. To cross to the other site it waits for the next 15-minute slot on the site link, unless you force it, which is what you’ll do with repadmin.

Here’s the site layout you’ll build:

Active Directory replication lab sites: HQ, Branch, HQ-Branch site link and tools
  1. Rename Default-First-Site-Name to HQ and give it the 10.0.0.0/24 subnet.
  2. Create Branch with more specific subnets: 10.0.0.11/32 (DC02) and 10.0.0.128/26 (where CL01’s 10.0.0.150 lives).
  3. Link the sites with HQ-Branch, cost 100, every 15 minutes.
  4. Move DC02’s server object to Branch.
  5. Check clients and replication with nltest and repadmin.

At a real company the branch would sit on a different network, but a more specific subnet inside the lab’s single network behaves the same way.

Hands-on Lab: Active Directory replication between two sites

Before you run any command, double-check it

Read every command twice before you press Enter. Check the target: the system or account, the IDs, the names and the sizes. These commands are for learning and were tested in our lab, not on your system. At work, run the read-only list commands first, follow your change process, make sure a backup exists, and ask a second person to check anything that changes or deletes data. You run them at your own risk.

Start DC01, DC02 and CL01, then sign in to DC01 as SAATLAB\adm.rahul and work in PowerShell as administrator.

1Rename the default site and add its subnet

On DC01:

Get-ADReplicationSite -Filter * | Select-Object Name
Rename-ADObject (Get-ADReplicationSite 'Default-First-Site-Name').DistinguishedName -NewName HQ
New-ADReplicationSubnet -Name '10.0.0.0/24' -Site HQ -Location 'Head office'
Get-ADReplicationSite -Filter * | Select-Object Name

You should see something like this:

Name
----
Default-First-Site-Name

Name
----
HQ

Renaming the default site is safe and very common. Every DC and site link that pointed to it follows the rename, because AD links objects by their identity and not by their name.

✅ Checkpoint: The only site is now called HQ and it owns the 10.0.0.0/24 subnet.

2Create the Branch site, its subnets and a site link

On DC01:

New-ADReplicationSite -Name Branch -Description 'Branch office'
New-ADReplicationSubnet -Name '10.0.0.11/32' -Site Branch -Location 'Branch DC'
New-ADReplicationSubnet -Name '10.0.0.128/26' -Site Branch -Location 'Branch clients'
New-ADReplicationSiteLink -Name 'HQ-Branch' -SitesIncluded HQ, Branch -Cost 100 -ReplicationFrequencyInMinutes 15 -InterSiteTransportProtocol IP
Get-ADReplicationSubnet -Filter * | Select-Object Name, @{n='Site';e={($_.Site -split ',')[0] -replace 'CN='}}
Get-ADReplicationSiteLink -Filter * | Select-Object Name, Cost, ReplicationFrequencyInMinutes

You should see something like this:

Name          Site
----          ----
10.0.0.0/24   HQ
10.0.0.11/32  Branch
10.0.0.128/26 Branch

Name              Cost ReplicationFrequencyInMinutes
----              ---- -----------------------------
DEFAULTIPSITELINK  100                           180
HQ-Branch          100                            15

DEFAULTIPSITELINK still holds only HQ, and replication will use HQ-Branch, every 15 minutes instead of the default 180.

✅ Checkpoint: Three subnets exist, two in Branch, and HQ-Branch replicates every 15 minutes.

3Move DC02 to the Branch site

On DC01:

Move-ADDirectoryServer -Identity DC02 -Site Branch
Get-ADDomainController -Filter * | Select-Object Name, IPv4Address, Site

You should see something like this:

Name IPv4Address Site
---- ----------- ----
DC01 10.0.0.10   HQ
DC02 10.0.0.11   Branch

Restart DC02 (or wait a while) so its Netlogon service registers DNS records for the Branch site, such as _ldap._tcp.Branch._sites.dc._msdcs.saatlab.internal. Clients in Branch use these records to find DC02 first.

Once DC02 has restarted, run this on DC01:

Resolve-DnsName -Type SRV _ldap._tcp.Branch._sites.dc._msdcs.saatlab.internal | Select-Object NameTarget

You should see something like this:

NameTarget
----------
DC02.saatlab.internal

✅ Checkpoint: DC02 shows Site Branch, and the Branch SRV record points to DC02.

4Check which site and DC CL01 uses

On CL01 (any user), restart Netlogon as admin or simply restart CL01, then run:

nltest /dsgetsite
nltest /dsgetdc:saatlab.internal | Select-String 'DC:|Dc Site Name|Our Site Name'

You should see something like this:

Branch
The command completed successfully
           DC: \\DC02.saatlab.internal
 Dc Site Name: Branch
Our Site Name: Branch

CL01’s address, 10.0.0.150, falls inside 10.0.0.128/26, which is the most specific match, so it lands in Branch and picks DC02. If DC02 went down, CL01 would fall back to a DC in another site.

✅ Checkpoint: CL01 reports site Branch and uses DC02.

Active Directory replication lab: CL01 in the Branch site using DC02
CL01 maps to Branch by its address and picks DC02, the DC in its own site.

5Watch and force replication

On DC01, look at the connections the KCC has built and at DC02’s inbound replication:

repadmin /kcc DC02
Get-ADReplicationConnection -Filter * -Server DC02 | Select-Object @{n='From';e={($_.ReplicateFromDirectoryServer -split ',')[1] -replace 'CN='}}, AutoGenerated
repadmin /showrepl DC02

You should see something like this (shortened):

From AutoGenerated
---- -------------
DC01          True

Branch\DC02
DSA Options: IS_GC
Site Options: (none)
...
==== INBOUND NEIGHBORS ======================================

DC=saatlab,DC=internal
    HQ\DC01 via RPC
        DSA object GUID: 5b1f...
        Last attempt @ 2026-10-19 22:51:12 was successful.

Now create a user on DC01 and push it over to DC02 without waiting the 15 minutes:

New-ADUser -Name 'Site Test' -SamAccountName site.test -Path 'OU=Sales,OU=Staff,OU=SAATLAB,DC=saatlab,DC=internal'
Get-ADUser site.test -Server DC02 -ErrorAction SilentlyContinue | Select-Object Name
repadmin /syncall DC01 /AdeP
Get-ADUser site.test -Server DC02 | Select-Object Name

You should see something like this:

CALLBACK MESSAGE: The following replication is in progress:
    From: 5b1f...._msdcs.saatlab.internal
    To  : 9e2c...._msdcs.saatlab.internal
CALLBACK MESSAGE: The following replication completed successfully:
...
CALLBACK MESSAGE: SyncAll Finished.
SyncAll terminated with no errors.

Name
----
Site Test

The first lookup on DC02 came back empty because the change hadn’t crossed the site link yet. /syncall with /AdeP pushes (P) all partitions (A) across sites (e) by DN (d). When you’re done, remove the test user with Remove-ADUser site.test -Confirm:$false.

✅ Checkpoint: site.test was missing on DC02, then present after repadmin /syncall finished with no errors.

Break It, Then Fix It

You’ll run into both of these replication problems on real networks: a DC that can’t be reached, and clients whose address doesn’t belong to any site.

1Break it: a DC that doesn’t answer

Shut down DC02, then try to push changes from DC01:

repadmin /syncall DC01 /AdeP

You’ll get an error like this:

SyncAll reported the following errors:
Error issuing replication: 1722 (0x6ba):
    The RPC server is unavailable.
    From: CN=NTDS Settings,CN=DC01,CN=Servers,CN=HQ,CN=Sites,CN=Configuration,DC=saatlab,DC=internal
    To  : CN=NTDS Settings,CN=DC02,CN=Servers,CN=Branch,CN=Sites,CN=Configuration,DC=saatlab,DC=internal

And the summary view:

repadmin /replsummary

You’ll see something like this:

Source DSA          largest delta    fails/total %%   error
 DC01                      08m:41s    5 /   5  100  (1722) The RPC server is unavailable.

Destination DSA     largest delta    fails/total %%   error
 DC02                      08m:41s    5 /   5  100  (1722) The RPC server is unavailable.

1722 means DC01 couldn’t reach DC02 over RPC at all, either because the server is down, a firewall is blocking RPC (TCP 135 plus dynamic ports) or DNS is pointing to the wrong address. It’s the most common replication error, and the checks go in this order: is it up, does its name resolve, and can you reach it (Test-NetConnection DC02 -Port 135).

Fix it: start DC02, then sync and check again:

repadmin /syncall DC01 /AdeP
repadmin /replsummary

✅ Checkpoint: replsummary showed 1722 while DC02 was off and 0 failures after it started and synced.

Active Directory replication lab: replsummary error 1722 RPC server unavailable
With DC02 down, every partition fails with 1722.

2Break it: clients in no site

On DC01, remove both subnets that cover CL01:

Remove-ADReplicationSubnet '10.0.0.128/26' -Confirm:$false
Remove-ADReplicationSubnet '10.0.0.0/24' -Confirm:$false

On CL01, as administrator, make Netlogon look up its site again:

Restart-Service Netlogon
nltest /dsgetsite

You’ll get an error like this:

Getting DC Site failed: Status = 1919 0x77f ERROR_NO_SITENAME

CL01 now belongs to no site, so it may pick any DC in the domain, even one on the far side of a slow link. DCs log this in the System log as NETLOGON event 5807 with a list of client addresses that don’t map to a site, and in big companies the usual cause is a new office subnet nobody added to AD.

Fix it: recreate the subnets, then restart Netlogon on CL01:

New-ADReplicationSubnet -Name '10.0.0.0/24' -Site HQ -Location 'Head office'          # on DC01
New-ADReplicationSubnet -Name '10.0.0.128/26' -Site Branch -Location 'Branch clients'  # on DC01
Restart-Service Netlogon; nltest /dsgetsite                                            # on CL01

✅ Checkpoint: CL01 reported ERROR_NO_SITENAME without subnets and Branch again after recreating them.

This happened at work

The DC that came back from the dead

A company closed a small office and shut its DC down in a cupboard, planning to decommission it properly “later”. Seven months on, someone found it, plugged it back in and switched it on. It hadn’t replicated for longer than the tombstone lifetime (180 days), so its partners refused to replicate with it and logged event 2042: “It has been too long since this machine last replicated with the named source machine.” Worse, it was still holding objects that had been deleted elsewhere months before, and those could have come back to life as lingering objects. The team didn’t try to force it back in. They removed its metadata from AD with ntdsutil metadata cleanup, wiped the server and checked the other DCs with repadmin /removelingeringobjects in advisory mode.

The fix: they wrote a decommissioning checklist (demote first, then clean up, and never just switch a DC off), and added monitoring that alerts when any DC hasn’t replicated for 24 hours.

The lesson: a DC that’s been offline past the tombstone lifetime must never rejoin, so demote DCs properly and check replication every day.

Common mistakes and troubleshooting

Mistake or symptomWhat happensWhat to do instead
Error 1722 RPC server unavailableDCs can’t replicateCheck the DC is up, DNS, and TCP 135 plus dynamic RPC ports
Subnets missing for new officesClients use distant DCs; event 5807Add every subnet to a site
Leaving the default 180-minute intervalBranch changes take hoursShorter intervals where links allow
Manually created connection objects everywhereThe KCC can’t adapt to failuresLet the KCC manage connections
Switching off a DC instead of demoting itMetadata left behind; risk of rejoin past tombstoneDemote, then metadata cleanup if needed
DC offline more than 180 days rejoiningLingering objects, event 2042Never reconnect; clean up and rebuild
Writable DC in an insecure branchTheft exposes every password hashRODC with a tight Password Replication Policy
Not monitoring replicationProblems found weeks laterDaily repadmin /replsummary or monitoring alerts
Firewalls between sites blocking RPCReplication fails silently between sitesOpen AD ports between DCs, or use a fixed RPC port

Interview questions

Click a question to open it. Each one is phrased the way an interviewer would ask it, and underneath you’ll find why they ask it and one way you could answer in your own words.

Fresher level

1. Can you explain in simple words what an AD site is and why we create them?

Why they ask this: They’re checking you understand the basic idea of sites and what they control.

How you might answer: An AD site is a group of well-connected subnets, usually one physical location. Sites decide which DC a client uses and how replication is scheduled between locations, so a user in Pune signs in to a DC in Pune and not one across the WAN.

2. What’s the difference between replication inside a site and replication between sites?

Why they ask this: They want to see that you understand the two replication modes and why they behave differently.

How you might answer: Inside a site, replication happens within seconds of a change and isn’t compressed. Between sites it follows the site link schedule and interval, it’s compressed, and it goes through bridgehead servers.

3. Your manager asks if AD replication is healthy right now. Which command would you run first?

Why they ask this: They want to know whether you’ve used repadmin yourself and know what to look for in its output.

How you might answer: I’d start with repadmin /replsummary, which gives an overview of failures and the largest delta for each DC. If something looks off, repadmin /showrepl shows the detail for each partner and partition.

2–5 years experience

4. Replication between two DCs fails with error 1722. What does that tell you, and what would you check?

Why they ask this: They want to see you can work through one of the most common replication errors step by step.

How you might answer: 1722 means the RPC server is unavailable, so either the partner DC is down, a firewall is in the way or DNS is pointing to the wrong place. I’d check name resolution first, then port 135 and the dynamic RPC range, and then the partner DC itself.

5. Nobody on your team created replication connections by hand, but they exist. Where do they come from?

Why they ask this: They’re checking you know about the KCC and how the replication topology gets built.

How you might answer: The Knowledge Consistency Checker, the KCC, builds those connection objects automatically, and whenever DCs or sites change it rebuilds them to match.

6. You see event 5807 on your domain controllers. What does it mean, and how would you fix it?

Why they ask this: They want to see you understand how clients get mapped to sites and what happens when a subnet is missing.

How you might answer: 5807 means clients are connecting from IP addresses that aren’t in any subnet defined in AD, so they have no site and may use any DC, even one far away. I’d open C:\Windows\debug\netlogon.log, which the event points to, pick out the client addresses with no site and add each missing subnet to the right site.

Senior level

7. Design AD sites for a company with a head office, two regional offices and 30 small shops. How would you set it up?

Why they ask this: They want to see that you can design for scale and balance cost, speed and security.

How you might answer: I’d create sites with DCs for the head office and the two regions, and set the site link costs to match the WAN. Each shop would either join its nearest regional site or get an RODC if it needs local sign-in. I’d make sure every subnet is mapped to a site, and monitor both replication and site coverage.

8. What are lingering objects, and how would you deal with them if you found some?

Why they ask this: They’re checking you know this advanced recovery topic and how to prevent it.

How you might answer: They’re objects that were deleted on other DCs but still live on a DC that missed the deletion for longer than the tombstone lifetime. I’d prevent them with strict replication consistency, clean them up with repadmin /removelingeringobjects, and never reconnect a DC that’s been offline that long.

9. A small branch has no IT staff and the server sits in a cupboard. Would you put a DC there, and if so, what kind?

Why they ask this: They want to see that you understand branch security and when an RODC makes sense.

How you might answer: If they need local sign-in, I’d put an RODC there, because if it’s stolen it doesn’t expose every password in the domain. I’d set the Password Replication Policy so only the branch users’ passwords get cached, and if needed delegate RODC admin rights to someone local.

Quick quiz

Q1. How does a client know which site it’s in?

  1. From its computer name
  2. Its IP address matches a subnet linked to a site
  3. From the user account
Show answer

B — The most specific subnet wins.

Q2. What did repadmin show while DC02 was off?

  1. Error 5
  2. Error 1722 RPC server unavailable
  3. No errors
Show answer

B — The partner couldn’t be reached.

Q3. What does /AdeP do with repadmin /syncall?

  1. Deletes partitions
  2. Pushes all partitions across sites
  3. Shows errors only
Show answer

B — A all, d DN, e enterprise, P push.

Q4. What did nltest /dsgetsite return with no subnets?

  1. HQ
  2. ERROR_NO_SITENAME
  3. Branch
Show answer

B — Clients in no site may use any DC.

Q5. In the work story, why couldn’t the old DC rejoin?

  1. Its password expired
  2. It had been offline past the tombstone lifetime
  3. Its disk failed
Show answer

B — Demote, clean up and rebuild instead.

Quick recap

  • Active Directory replication copies changes between DCs, in seconds within a site and on a schedule between sites.
  • A site is a group of subnets, and a client finds its site through the most specific subnet.
  • Site links have costs and intervals, and the KCC builds the connections automatically.
  • repadmin /replsummary, /showrepl and /syncall /AdeP are your daily tools.
  • 1722 means the partner can’t be reached, and 5807 means there are clients without a site.
  • Never reconnect a DC that’s been offline past the tombstone lifetime, and use RODCs in insecure branches.

Next lesson

Lesson 32: AD backup and recovery → Next you’ll back up a DC’s system state, restore a deleted OU authoritatively in DSRM, seize an FSMO role from a dead DC and clean up its metadata.

Further reading: Active Directory replication

Want to go deeper into Active Directory replication? Microsoft’s common AD replication errors page explains each error code, and the replication and topology with PowerShell guide covers the cmdlets used here. You can also see the full plan for this course on the Windows Server Administration course page.

Scroll to Top

This website uses cookies

We use a few cookies to keep this site working. If you allow it, we also use Google Analytics to count visits so we can improve our lessons. You can accept all, deny the optional ones, or choose what to allow.