PowerShell script for diagnosing, auditing, and monitoring Active Directory replication health across domain controllers.
The tool performs a multi-layer health check including replication status, DNS resolution, and time synchronization β essential for troubleshooting Active Directory issues and validating domain health.
Active Directory Replication, AD Replication Monitoring, PowerShell AD Replication, Repadmin alternative, DCDiag replacement, Domain Controller replication status, Get-ADReplicationPartnerMetadata, AD health check script, replication failure detection, SYSVOL replication, DFSR, Kerberos time sync, DNS resolution AD, Windows Server AD diagnostics
- Features
- Prerequisites
- Installation
- Quick Start
- Examples
- Output
- Object Model
- Use Cases
- Documentation
- License
- Author
- Lists all domain controllers in the domain
- Checks replication partner health and status
- Detects replication delays and failures
- Validates DNS resolution for all DCs
- Checks time synchronization (Kerberos critical dependency)
- Provides structured PowerShell object output for automation
- Supports verbose troubleshooting mode
- Windows PowerShell 5.1 or PowerShell 7+
- Active Directory PowerShell module (RSAT-AD-PowerShell)
- Domain user account with read permissions
- Network connectivity to domain controllers
- (Optional) WinRM enabled for time synchronization checks
git clone https://github.com/vgorin-lab/ad-replication-tools.git
cd ad-replication-toolsInvoke-WebRequest -Uri "https://raw.githubusercontent.com/vgorin-lab/ad-replication-tools/main/Test-ADReplication.ps1" -OutFile "Test-ADReplication.ps1"Run a basic Active Directory replication health check:
.\Test-ADReplication.ps1.\Test-ADReplication.ps1 -Domain corp.contoso.com.\Test-ADReplication.ps1 -Verbose$health = .\Test-ADReplication.ps1
$health.OverallHealth
$health.ReplicationErrors
$health.DnsErrors
$health.TimeErrorsThe script provides structured console output and machine-readable results.
========================================
Active Directory Replication Health Check
========================================
Domain: corp.contoso.com
Timestamp: 2026-06-11 17:40:00
Domain Controllers: 4
β DC01 β DC02 : Replication healthy
β DC02 β DC03 : Last success 2026-06-11 15:20
β DC03: Unable to query replication status
β dc01.corp.contoso.com resolves to 10.0.0.1
β dc03.corp.contoso.com DNS resolution failed
β DC01: Time sync OK (0.42s)
β DC02: Time drift detected (6.31s)
The script returns a PowerShell object for automation:
$report = .\Test-ADReplication.ps1
$report | Format-ListDomain
DomainControllers
ReplicationErrors
DnsErrors
TimeErrors
OverallHealth
Timestamp
SourceDC
PartnerDC
LastSuccess
Status
Example:
SourceDC : DC02
PartnerDC : DC03
LastSuccess : 2026-06-11 15:20
Status : Delayed
Healthy
IssuesFound
Error
- Active Directory replication troubleshooting
- Post-DC deployment validation
- Pre-migration health checks
- Monitoring AD infrastructure health
- Replacement for basic repadmin /replsummary workflows
- DNS and Kerberos validation in domain environments
Built using native Microsoft Active Directory PowerShell cmdlets:
- Get-ADDomainController
- Get-ADReplicationPartnerMetadata
- Resolve-DnsName
- Invoke-Command (WinRM time validation)
More guides and sysadmin tools: https://sysadmintips.ru
Distributed under the MIT License. See LICENSE file for details.
Vlad Gorin (vgorin-lab)