How to Manage Active Directory Replication on Windows Server 2012 R2
Active Directory replication is the process by which changes made on one domain controller are propagated to all other domain controllers in the domain and forest. Replication ensures that the directory remains consistent across all DCs, regardless of which DC accepted the original change. Windows Server 2012 R2 uses a multi-master replication model where any writable DC can accept changes. Understanding and managing replication is critical to maintaining directory health and preventing authentication failures, stale data, and USN rollback scenarios. This guide covers monitoring, troubleshooting, and forcing replication using both built-in tools and PowerShell.
Prerequisites
You need Domain Admin rights to manage replication. The ActiveDirectory module and repadmin command-line tool are your primary management interfaces. Ensure the Active Directory Domain Services role is installed:
Import-Module ActiveDirectory
Understanding the Replication Model
AD DS uses a pull-based, change notification replication model. When a writable DC receives a change, it notifies its replication partners after a short delay (5 seconds by default within a site, 30 seconds for subsequent partners). The partner then pulls the changes. Each object attribute has an associated version number and timestamp stored in the Update Sequence Number (USN) and the originating write metadata. This allows DCs to determine which changes they have already received and which are new.
The Active Directory replication topology is maintained by the KCC (Knowledge Consistency Checker) process, which runs every 15 minutes and generates or removes connection objects as needed. The ISTG (Inter-Site Topology Generator) handles replication topology for inter-site connections.
Monitoring Replication Status
The repadmin tool is the definitive utility for monitoring and managing AD replication:
# Show replication status for all DCs in the forest
repadmin /replsummary
# Show replication partners and their status
repadmin /showrepl
# Show replication status for a specific DC
repadmin /showrepl DC-LON-01
# Show replication failures across all DCs
repadmin /showrepl * /errorsonly
# Show connection objects and partners
repadmin /showconn
Use the Get-ADReplicationPartnerMetadata and related cmdlets for PowerShell-based monitoring:
# Get replication partner metadata for all DCs
Get-ADReplicationPartnerMetadata -Target * -Scope Forest |
Select-Object Server, Partner, LastReplicationSuccess, LastReplicationAttempt,
LastReplicationResult, ConsecutiveReplicationFailures |
Where-Object {$_.ConsecutiveReplicationFailures -gt 0}
# Get replication failure summary
Get-ADReplicationFailure -Target * -Scope Forest |
Select-Object Server, Partner, FirstFailureTime, FailureCount, FailureType
Forcing Immediate Replication
In some scenarios you need changes to replicate immediately rather than waiting for the scheduled replication cycle. Use repadmin or the Sync-ADObject cmdlet:
# Force replication from a specific partner to the local DC
repadmin /replicate DC-LON-01 DC-NY-01 "DC=contoso,DC=com"
# Replicate all naming contexts from a specific partner
repadmin /syncall DC-LON-01 /AdeP
# Sync all DCs in the domain (dangerous in large environments — use with caution)
repadmin /syncall /AdeP
# Sync a specific object to all DCs
Sync-ADObject -Object "CN=Jane Smith,OU=Users,OU=Contoso,DC=contoso,DC=com" `
-Source "DC-LON-01" `
-Destination "DC-NY-01"
The repadmin /syncall switches have the following meanings:
/A replicates all naming contexts. /d uses fully qualified DSA names. /e includes enterprise DCs across sites. /P pushes changes (instead of pull). The /e flag crosses site boundaries and can generate significant traffic — use it only when necessary.
Checking Replication Topology
# Show the KCC-generated replication topology
repadmin /showconn
# Force the KCC to recalculate the topology
repadmin /kcc
# Force KCC recalculation on all DCs in the domain
repadmin /kcc * /e
# Show connection objects from AD
Get-ADReplicationConnection -Filter * |
Select-Object Name, AutoGenerated, ReplicateFromDirectoryServer,
ReplicateToDirectoryServer, ScheduledSync
Checking Replication Queue and Latency
# Show items in the replication queue
repadmin /queue DC-LON-01
# Check replication latency for a specific object type
repadmin /latency
# Show detailed metadata for a specific object
repadmin /showobjmeta DC-LON-01 "CN=Jane Smith,OU=Users,OU=Contoso,DC=contoso,DC=com"
Diagnosing Replication Errors
Common replication error codes and their meanings:
Error 1722 (RPC Server Unavailable) indicates network connectivity issues between DCs, firewall blocking RPC ports, or the DC being offline. Error 1256 (The Remote System Is Not Available) also indicates connectivity problems. Error 8453 (Replication Access Was Denied) indicates the replication account lacks necessary permissions. Error 8606 (Insufficient Attributes Were Given to Create an Object) often indicates a lingering object problem.
# Test replication connectivity
repadmin /replicate DC-NY-01 DC-LON-01 "DC=contoso,DC=com" /force
# Check for lingering objects
repadmin /removelingeringobjects DC-NY-01 DC-LON-01 "DC=contoso,DC=com" /advisory_mode
# Remove lingering objects (after confirming in advisory mode)
repadmin /removelingeringobjects DC-NY-01 DC-LON-01 "DC=contoso,DC=com"
# Check USN health
repadmin /showutdvec DC-LON-01 "DC=contoso,DC=com"
Configuring Replication Intervals
Intra-site replication uses change notification and cannot be significantly configured. Inter-site replication frequency is controlled by the site link configuration. To adjust intra-site notification delay (not recommended for production without testing):
# View current replication notification delay (default 5 seconds intra-site)
# This is stored in the registry on each DC
Get-ItemProperty "HKLM:SYSTEMCurrentControlSetServicesNTDSParameters" |
Select-Object "Replicator notify pause after modify (secs)",
"Replicator notify pause between DSAs (secs)"
# Modify notification delay (use with caution)
Set-ItemProperty -Path "HKLM:SYSTEMCurrentControlSetServicesNTDSParameters" `
-Name "Replicator notify pause after modify (secs)" `
-Value 5
Verifying Replication Health After Changes
# Run the complete replication diagnostics test
dcdiag /test:replications /v
# Run all dcdiag tests
dcdiag /a /v
# Test DNS registration for all DCs
dcdiag /test:dns /v /e
# Check netlogon service and DC locator
nltest /dsgetsite
nltest /dclist:contoso.com
Monitoring with Event Logs
The Directory Service event log is the primary source for replication-related events. Key Event IDs include 1864 (replication has not occurred for too long), 1925 (attempt to establish a replication link failed), 2042 (replication has not occurred with a partner for a tombstone lifetime), and 1311 (the replication configuration information in Active Directory is inconsistent):
# Query Directory Service log for replication errors
Get-WinEvent -LogName "Directory Service" -MaxEvents 100 |
Where-Object {$_.LevelDisplayName -eq "Error" -or $_.LevelDisplayName -eq "Warning"} |
Select-Object TimeCreated, Id, LevelDisplayName, Message |
Format-List
Summary
Active Directory replication management on Windows Server 2012 R2 requires regular monitoring to detect and resolve issues before they cause directory inconsistencies or authentication failures. The repadmin tool provides comprehensive visibility into replication status, topology, and errors. PowerShell cmdlets like Get-ADReplicationPartnerMetadata and Get-ADReplicationFailure enable automated monitoring and alerting. Always investigate replication failures promptly — lingering objects, USN rollback, and orphaned connection objects can compound into serious problems if left unaddressed. The dcdiag tool provides a comprehensive diagnostic check and should be run regularly or after any infrastructure change.