In partnership with

THE PROBLEM

Active Directory replication is the failure that gives you two months of warning and then no recovery.

When replication breaks between two DCs, nothing announces it. Users authenticate normally — they're just hitting one DC or the other, and both are serving data they already have. Group Policy applies. Logons work. Monitoring is green because the service is running and the server is up.

Underneath, the two DCs are slowly diverging. A password changed on DC01 doesn't reach DC02. A user disabled in Dallas is still active in Houston. A group membership granted last week exists on one DC and not the other, which means the user's access depends entirely on which DC they happen to authenticate against. That's the maddening phase — intermittent problems that resolve themselves when the user retries and lands on a different DC.

Then you hit the tombstone lifetime. Default is 180 days on anything built in the last decade, 60 on much older domains. Past that point a DC that hasn't replicated is considered irreparably stale, and AD will refuse to replicate it at all. The supported recovery is demotion, metadata cleanup, and rebuild. There is no "force it to catch up" option, because the deleted-object records it needs have themselves been purged.

So: a problem that gives no symptoms, degrades silently for months, and then converts from "fix the replication" to "rebuild the domain controller."

This week we watch it.

THE SCRIPT

Save the script below to:

C:\Scripts\ADReplicationMonitor.ps1

powershell

# Active Directory Replication Health Monitor
# Automate & Operate — automateandoperate.com

Import-Module ActiveDirectory

# Email settings — update these
$from = "[email protected]"
$to = "[email protected]"
$smtpServer = "your.smtp.server"
$smtpPort = 587
$username = "[email protected]"
$password = ConvertTo-SecureString "yourpassword" -AsPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential($username, $password)

$logFile = "C:\Logs\ADReplicationMonitor.log"
$reportFile = "C:\Logs\ADReplicationReport.csv"

# Hours since last successful replication before warning / critical
$replicationWarningHours = 6
$replicationCriticalHours = 24

# Percentage of tombstone lifetime consumed before alerting
$tombstoneWarningPercent = 25
$tombstoneCriticalPercent = 50

# Consecutive failure count thresholds
$failureCountWarning = 3
$failureCountCritical = 10

# Create log folder if missing
if (-not (Test-Path "C:\Logs")) {
    New-Item -ItemType Directory -Path "C:\Logs" -Force | Out-Null
}

$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
$dateStamp = Get-Date -Format "yyyy-MM-dd"

$report = @()
$critical = @()
$warnings = @()
$unreachableDCs = @()
$fsmoIssues = @()
$sysvolIssues = @()

# ---------- DOMAIN AND TOMBSTONE LIFETIME ----------
$domainName = "UNKNOWN"
$tombstoneLifetime = 180

try {
    $domain = Get-ADDomain -ErrorAction Stop
    $domainName = $domain.DNSRoot

    $configNC = (Get-ADRootDSE).configurationNamingContext
    $dsService = Get-ADObject -Identity "CN=Directory Service,CN=Windows NT,CN=Services,$configNC" `
        -Properties tombstoneLifetime -ErrorAction SilentlyContinue

    if ($dsService.tombstoneLifetime) {
        $tombstoneLifetime = $dsService.tombstoneLifetime
    }

    Add-Content -Path $logFile -Value "$timestamp — Domain: $domainName — Tombstone lifetime: $tombstoneLifetime days"

} catch {
    Add-Content -Path $logFile -Value "$timestamp — Could not read domain info: $_"
}

# ---------- GET ALL DOMAIN CONTROLLERS ----------
$dcs = @()
try {
    $dcs = Get-ADDomainController -Filter * -ErrorAction Stop
    Add-Content -Path $logFile -Value "$timestamp — Found $($dcs.Count) domain controller(s)"
} catch {
    Add-Content -Path $logFile -Value "$timestamp — DC enumeration failed: $_"
}

# ---------- FSMO ROLE HOLDERS ----------
$fsmoHolders = @{}
try {
    $forest = Get-ADForest -ErrorAction Stop
    $fsmoHolders["SchemaMaster"]        = $forest.SchemaMaster
    $fsmoHolders["DomainNamingMaster"]  = $forest.DomainNamingMaster
    $fsmoHolders["PDCEmulator"]         = $domain.PDCEmulator
    $fsmoHolders["RIDMaster"]           = $domain.RIDMaster
    $fsmoHolders["InfrastructureMaster"] = $domain.InfrastructureMaster
} catch {
    Add-Content -Path $logFile -Value "$timestamp — FSMO lookup failed: $_"
}

# ---------- REPLICATION PARTNER METADATA ----------
foreach ($dc in $dcs) {

    $dcName = $dc.HostName

    try {
        $partners = Get-ADReplicationPartnerMetadata -Target $dcName -ErrorAction Stop

        foreach ($partner in $partners) {

            $flags = @()

            $partnerName = ($partner.Partner -split ',')[1] -replace 'CN=', ''
            if (-not $partnerName) { $partnerName = $partner.Partner }

            $lastSuccess = $partner.LastReplicationSuccess
            $lastAttempt = $partner.LastReplicationAttempt
            $failureCount = $partner.ConsecutiveReplicationFailures
            $lastResult = $partner.LastReplicationResult

            # Hours since last successful replication
            $hoursSinceSuccess = if ($lastSuccess -and $lastSuccess -gt [datetime]"1601-01-01") {
                [math]::Round((New-TimeSpan -Start $lastSuccess -End (Get-Date)).TotalHours, 1)
            } else {
                "NEVER"
            }

            # Days since last success, for tombstone comparison
            $daysSinceSuccess = if ($hoursSinceSuccess -ne "NEVER") {
                [math]::Round($hoursSinceSuccess / 24, 1)
            } else {
                999
            }

            $tombstonePercent = if ($daysSinceSuccess -ne 999) {
                [math]::Round(($daysSinceSuccess / $tombstoneLifetime) * 100, 1)
            } else {
                100
            }

            $daysUntilTombstone = if ($daysSinceSuccess -ne 999) {
                [math]::Round($tombstoneLifetime - $daysSinceSuccess, 1)
            } else {
                0
            }

            # ---- Evaluate ----
            if ($hoursSinceSuccess -eq "NEVER") {
                $flags += "NEVER REPLICATED SUCCESSFULLY"
            } elseif ($hoursSinceSuccess -ge $replicationCriticalHours) {
                $flags += "NO SUCCESS IN $hoursSinceSuccess HOURS"
            } elseif ($hoursSinceSuccess -ge $replicationWarningHours) {
                $flags += "LAST SUCCESS $hoursSinceSuccess HOURS AGO"
            }

            if ($failureCount -ge $failureCountCritical) {
                $flags += "$failureCount CONSECUTIVE FAILURES"
            } elseif ($failureCount -ge $failureCountWarning) {
                $flags += "$failureCount consecutive failures"
            }

            if ($lastResult -ne 0) {
                $flags += "LAST RESULT CODE: $lastResult"
            }

            if ($tombstonePercent -ge $tombstoneCriticalPercent) {
                $flags += "*** $tombstonePercent% OF TOMBSTONE LIFETIME CONSUMED — $daysUntilTombstone DAYS TO REBUILD ***"
            } elseif ($tombstonePercent -ge $tombstoneWarningPercent) {
                $flags += "$tombstonePercent% of tombstone lifetime consumed"
            }

            $status = if ($flags -match "NEVER REPLICATED|TOMBSTONE LIFETIME CONSUMED|NO SUCCESS IN|CONSECUTIVE FAILURES") {
                "CRITICAL"
            } elseif ($flags.Count -gt 0) {
                "WARNING"
            } else {
                "OK"
            }

            $entry = [PSCustomObject]@{
                Date              = $dateStamp
                DC                = ($dcName -split '\.')[0]
                Partner           = $partnerName
                PartitionDN       = $partner.Partition
                LastSuccess       = if ($lastSuccess -and $lastSuccess -gt [datetime]"1601-01-01") { $lastSuccess.ToString("yyyy-MM-dd HH:mm") } else { "NEVER" }
                LastAttempt       = if ($lastAttempt -and $lastAttempt -gt [datetime]"1601-01-01") { $lastAttempt.ToString("yyyy-MM-dd HH:mm") } else { "NEVER" }
                HoursSinceSuccess = $hoursSinceSuccess
                FailureCount      = $failureCount
                LastResultCode    = $lastResult
                TombstonePercent  = $tombstonePercent
                DaysUntilRebuild  = $daysUntilTombstone
                Status            = $status
                Flags             = if ($flags.Count -gt 0) { $flags -join "; " } else { "OK" }
            }

            $report += $entry
            if ($status -eq "CRITICAL") { $critical += $entry }
            if ($status -eq "WARNING")  { $warnings += $entry }

            Add-Content -Path $logFile -Value "$timestamp — $($entry.DC) <- $partnerName — last success $($entry.LastSuccess) — failures $failureCount — $status"
        }

    } catch {
        $unreachableDCs += [PSCustomObject]@{
            DC     = ($dcName -split '\.')[0]
            Reason = $_.Exception.Message
        }
        Add-Content -Path $logFile -Value "$timestamp — $dcName — UNREACHABLE: $_"
    }
}

# ---------- PER-DC HEALTH CHECKS ----------
$dcHealth = @()

foreach ($dc in $dcs) {

    $dcName = $dc.HostName
    $shortName = ($dcName -split '\.')[0]

    try {
        $health = Invoke-Command -ComputerName $dcName -ScriptBlock {

            # Critical AD services
            $services = @("NTDS", "DNS", "Netlogon", "W32Time", "KDC", "DFSR")
            $svcStatus = @()
            foreach ($s in $services) {
                $svc = Get-Service -Name $s -ErrorAction SilentlyContinue
                if ($svc) {
                    $svcStatus += "$s=$($svc.Status)"
                }
            }

            # SYSVOL and NETLOGON shares present?
            $shares = (Get-SmbShare -ErrorAction SilentlyContinue).Name
            $sysvolShared = $shares -contains "SYSVOL"
            $netlogonShared = $shares -contains "NETLOGON"

            # DFSR replication state for SYSVOL
            $dfsrState = "UNKNOWN"
            try {
                $dfsr = Get-CimInstance -Namespace "root\microsoftdfs" `
                    -ClassName DfsrReplicatedFolderInfo -ErrorAction SilentlyContinue |
                    Where-Object { $_.ReplicatedFolderName -eq "SYSVOL Share" }
                if ($dfsr) {
                    $stateMap = @{
                        0 = "Uninitialized"; 1 = "Initialized"; 2 = "Initial Sync"
                        3 = "Auto Recovery";  4 = "Normal";      5 = "In Error"
                    }
                    $dfsrState = $stateMap[[int]$dfsr.State]
                }
            } catch { }

            # Free space on the NTDS volume
            $ntdsPath = (Get-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Services\NTDS\Parameters" `
                -Name "DSA Database file" -ErrorAction SilentlyContinue)."DSA Database file"
            $ntdsFreePercent = "UNKNOWN"
            if ($ntdsPath) {
                $driveLetter = (Split-Path -Qualifier $ntdsPath).TrimEnd(':')
                $vol = Get-CimInstance Win32_LogicalDisk -Filter "DeviceID='${driveLetter}:'" -ErrorAction SilentlyContinue
                if ($vol) {
                    $ntdsFreePercent = [math]::Round(($vol.FreeSpace / $vol.Size) * 100, 1)
                }
            }

            # Advertising as a DC?
            $advertising = $false
            try {
                $dcdiag = dcdiag /test:advertising 2>&1 | Out-String
                $advertising = $dcdiag -match "passed test Advertising"
            } catch { }

            [PSCustomObject]@{
                Services        = $svcStatus -join "; "
                SysvolShared    = $sysvolShared
                NetlogonShared  = $netlogonShared
                DfsrState       = $dfsrState
                NtdsFreePercent = $ntdsFreePercent
                Advertising     = $advertising
            }

        } -ErrorAction Stop

        $dcFlags = @()

        if ($health.Services -match "NTDS=Stopped|Netlogon=Stopped|KDC=Stopped|DNS=Stopped") {
            $dcFlags += "CRITICAL SERVICE STOPPED"
        }
        if (-not $health.SysvolShared) {
            $dcFlags += "SYSVOL NOT SHARED"
            $sysvolIssues += "$shortName — SYSVOL share missing"
        }
        if (-not $health.NetlogonShared) {
            $dcFlags += "NETLOGON NOT SHARED"
            $sysvolIssues += "$shortName — NETLOGON share missing"
        }
        if ($health.DfsrState -eq "In Error") {
            $dcFlags += "DFSR SYSVOL REPLICATION IN ERROR"
            $sysvolIssues += "$shortName — DFSR state: In Error"
        }
        if ($health.NtdsFreePercent -ne "UNKNOWN" -and [double]$health.NtdsFreePercent -lt 15) {
            $dcFlags += "NTDS VOLUME $($health.NtdsFreePercent)% FREE"
        }
        if (-not $health.Advertising) {
            $dcFlags += "NOT ADVERTISING AS DC"
        }

        $dcHealth += [PSCustomObject]@{
            DC              = $shortName
            Services        = $health.Services
            SysvolShared    = $health.SysvolShared
            NetlogonShared  = $health.NetlogonShared
            DfsrState       = $health.DfsrState
            NtdsFreePercent = $health.NtdsFreePercent
            Advertising     = $health.Advertising
            Status          = if ($dcFlags.Count -gt 0) { "ISSUES" } else { "OK" }
            Flags           = if ($dcFlags.Count -gt 0) { $dcFlags -join "; " } else { "OK" }
        }

        Add-Content -Path $logFile -Value "$timestamp — $shortName — DFSR: $($health.DfsrState) — SYSVOL: $($health.SysvolShared) — $($dcFlags -join '; ')"

    } catch {
        $dcHealth += [PSCustomObject]@{
            DC              = $shortName
            Services        = "UNREACHABLE"
            SysvolShared    = "N/A"
            NetlogonShared  = "N/A"
            DfsrState       = "N/A"
            NtdsFreePercent = "N/A"
            Advertising     = "N/A"
            Status          = "ERROR"
            Flags           = "UNREACHABLE: $($_.Exception.Message)"
        }
    }
}

# ---------- FSMO ROLE HOLDER REACHABILITY ----------
foreach ($role in $fsmoHolders.Keys) {
    $holder = $fsmoHolders[$role]
    if ($holder) {
        $holderShort = ($holder -split '\.')[0]
        $holderEntry = $dcHealth | Where-Object { $_.DC -eq $holderShort }
        if ($holderEntry -and $holderEntry.Status -ne "OK") {
            $fsmoIssues += "$role held by $holderShort — $($holderEntry.Flags)"
        }
    }
}

# ---------- EXPORT ----------
$report | Sort-Object Status, DC | Export-Csv -Path $reportFile -NoTypeInformation

# ---------- BUILD EMAIL ----------
$tombstoneCritical = $report | Where-Object { $_.TombstonePercent -ge $tombstoneCriticalPercent }
$worstPartner = $report | Where-Object { $_.HoursSinceSuccess -ne "NEVER" } |
    Sort-Object { [double]$_.HoursSinceSuccess } -Descending | Select-Object -First 1

$emailBody  = "Active Directory Replication Health — $timestamp`n"
$emailBody += "Domain: $domainName`n"
$emailBody += "Domain controllers: $($dcs.Count)  |  Unreachable: $($unreachableDCs.Count)`n"
$emailBody += "Replication links checked: $($report.Count)`n"
$emailBody += "Tombstone lifetime: $tombstoneLifetime days`n`n"
$emailBody += "CRITICAL: $($critical.Count)  |  WARNING: $($warnings.Count)`n"
$emailBody += "SYSVOL issues: $($sysvolIssues.Count)  |  FSMO holder issues: $($fsmoIssues.Count)`n`n"

if ($tombstoneCritical.Count -gt 0) {
    $emailBody += "*** TOMBSTONE LIFETIME WARNING — REBUILD RISK ***`n"
    $emailBody += "These links have not replicated for a significant fraction of the`n"
    $emailBody += "tombstone lifetime. Past 100%, the DC must be demoted and rebuilt.`n"
    $emailBody += "=" * 60 + "`n"
    foreach ($t in ($tombstoneCritical | Sort-Object TombstonePercent -Descending)) {
        $emailBody += "DC:            $($t.DC)`n"
        $emailBody += "Partner:       $($t.Partner)`n"
        $emailBody += "Last success:  $($t.LastSuccess)`n"
        $emailBody += "Consumed:      $($t.TombstonePercent)% of tombstone lifetime`n"
        $emailBody += "DAYS LEFT:     $($t.DaysUntilRebuild)`n"
        $emailBody += "-" * 40 + "`n"
    }
    $emailBody += "`n"
}

if ($critical.Count -gt 0) {
    $emailBody += "CRITICAL REPLICATION FAILURES:`n"
    $emailBody += "=" * 60 + "`n"
    foreach ($c in $critical) {
        $emailBody += "$($c.DC)  <-  $($c.Partner)`n"
        $emailBody += "   Partition:    $($c.PartitionDN)`n"
        $emailBody += "   Last success: $($c.LastSuccess)`n"
        $emailBody += "   Failures:     $($c.FailureCount)  |  Result code: $($c.LastResultCode)`n"
        $emailBody += "   $($c.Flags)`n"
        $emailBody += "-" * 40 + "`n"
    }
    $emailBody += "`n"
}

if ($sysvolIssues.Count -gt 0) {
    $emailBody += "SYSVOL / DFSR ISSUES — GROUP POLICY MAY NOT APPLY:`n"
    $emailBody += "=" * 60 + "`n"
    $sysvolIssues | ForEach-Object { $emailBody += "  !! $_`n" }
    $emailBody += "`n"
}

if ($fsmoIssues.Count -gt 0) {
    $emailBody += "FSMO ROLE HOLDERS WITH PROBLEMS:`n"
    $emailBody += "=" * 60 + "`n"
    $fsmoIssues | ForEach-Object { $emailBody += "  !! $_`n" }
    $emailBody += "`n"
}

if ($warnings.Count -gt 0) {
    $emailBody += "WARNINGS:`n"
    $emailBody += "=" * 60 + "`n"
    foreach ($w in $warnings) {
        $emailBody += "$($w.DC) <- $($w.Partner) — $($w.Flags)`n"
    }
    $emailBody += "`n"
}

$emailBody += "DOMAIN CONTROLLER HEALTH:`n"
$emailBody += "=" * 60 + "`n"
foreach ($d in $dcHealth) {
    $emailBody += "[$($d.Status)] $($d.DC)`n"
    $emailBody += "   Services:  $($d.Services)`n"
    $emailBody += "   SYSVOL: $($d.SysvolShared)  NETLOGON: $($d.NetlogonShared)  DFSR: $($d.DfsrState)`n"
    $emailBody += "   NTDS volume free: $($d.NtdsFreePercent)%  |  Advertising: $($d.Advertising)`n"
    if ($d.Status -ne "OK") { $emailBody += "   ISSUES: $($d.Flags)`n" }
}

$emailBody += "`nFSMO ROLE HOLDERS:`n"
$emailBody += "=" * 60 + "`n"
foreach ($role in $fsmoHolders.Keys) {
    $emailBody += "$role : $($fsmoHolders[$role])`n"
}

if ($unreachableDCs.Count -gt 0) {
    $emailBody += "`nUNREACHABLE DOMAIN CONTROLLERS:`n"
    $emailBody += "=" * 60 + "`n"
    foreach ($u in $unreachableDCs) {
        $emailBody += "$($u.DC) — $($u.Reason)`n"
    }
}

if ($critical.Count -eq 0 -and $warnings.Count -eq 0 -and $sysvolIssues.Count -eq 0) {
    $emailBody += "`nAll replication links healthy. SYSVOL replicating normally.`n"
}

$emailBody += "`nFull report: $reportFile`n`n"
$emailBody += "Diagnostic commands:`n"
$emailBody += "  repadmin /replsummary            Quick summary across all DCs`n"
$emailBody += "  repadmin /showrepl               Detailed replication state`n"
$emailBody += "  repadmin /syncall /AdeP          Force full sync`n"
$emailBody += "  dcdiag /test:replications`n"
$emailBody += "  dcdiag /test:netlogons`n"
$emailBody += "  Get-DfsrBacklog                  SYSVOL replication backlog`n`n"
$emailBody += "Automate & Operate — automateandoperate.com"

$subject = if ($tombstoneCritical.Count -gt 0) {
    "*** AD CRITICAL: replication link at $(($tombstoneCritical | Measure-Object TombstonePercent -Maximum).Maximum)% of tombstone lifetime ***"
} elseif ($critical.Count -gt 0) {
    "AD REPLICATION CRITICAL: $($critical.Count) failing link(s)"
} elseif ($sysvolIssues.Count -gt 0) {
    "AD Warning — SYSVOL issues on $($sysvolIssues.Count) DC(s)"
} elseif ($warnings.Count -gt 0) {
    "AD Replication — $($warnings.Count) warning(s)"
} else {
    "AD Replication Health — All $($dcs.Count) DC(s) replicating normally"
}

Send-MailMessage `
    -From $from -To $to `
    -Subject $subject `
    -Body $emailBody `
    -SmtpServer $smtpServer -Port $smtpPort `
    -UseSsl -Credential $credential

Update these lines:

  • $from / $to / $username / $password — your email details

  • $smtpServer — your SMTP server (e.g. smtp.office365.com)

  • $replicationWarningHours / $replicationCriticalHours — 6 and 24 suit most environments

  • $tombstoneWarningPercent / $tombstoneCriticalPercent — 25% and 50% give generous runway

Requirements: RSAT ActiveDirectory module, PowerShell remoting to DCs, Domain Admin or equivalent read rights on replication metadata.

THE TOMBSTONE MATH IS THE POINT

Most replication monitoring tells you a link is failing. That's useful but it doesn't convey urgency, which is why failing links sit in dashboards for weeks.

The script reads your actual tombstone lifetime from the directory — don't assume 180, older domains upgraded over many years sometimes still carry 60 — and converts time-since-last-success into a percentage consumed and a days-remaining figure.

"DC02 replication failing" is a ticket. "DC02 has 94 days before it must be demoted and rebuilt" is a priority.

The thresholds are set generously on purpose. At 25% consumed you've still got months. At 50% you're halfway to a rebuild with no recovery path, and that should feel uncomfortable.

One caveat worth knowing: the tombstone clock applies per naming context, and a DC can be fine on the domain partition while failing on the configuration or schema partition. The script reports per-partition because that distinction matters.

SYSVOL REPLICATION IS A SEPARATE SYSTEM

This catches people out. AD replication and SYSVOL replication are two different mechanisms. AD object data replicates through the directory service. SYSVOL — which holds Group Policy templates and logon scripts — replicates through DFSR.

Either can break independently. You can have perfect AD replication and a SYSVOL that stopped replicating eight months ago, which means GPO changes made on DC01 never reach DC02, and whether a policy applies depends on which DC a machine talks to. That produces beautifully inconsistent symptoms.

The script checks three things per DC: that SYSVOL and NETLOGON are actually shared, and that DFSR reports the SYSVOL replicated folder in Normal state.

If DFSR reports In Error, that's immediate. The usual culprit is a dirty shutdown causing a DFSR database issue, and the recovery is documented but fiddly. Check the backlog:

powershell

Get-DfsrBacklog -SourceComputerName "DC01" -DestinationComputerName "DC02" `
    -GroupName "Domain System Volume" -FolderName "SYSVOL Share"

If SYSVOL isn't shared at all, that DC is not functioning as a DC properly regardless of what else looks healthy.

WHAT THE RESULT CODES MEAN

The LastResultCode field is the actual error, and a handful account for most real-world failures:

8524 — DSA operation unable to proceed because of DNS lookup failure. This is the most common one by a wide margin, and it's almost always DNS rather than replication. The DC can't resolve its partner's GUID-based CNAME in the _msdcs zone.

1256 — remote system not available. Network, firewall, or the DC is genuinely down.

1722 — RPC server unavailable. Usually firewall. AD replication needs RPC endpoint mapper on 135 plus a dynamic high port range, and a firewall change that restricted that range breaks replication while leaving everything else working.

1908 — could not find the domain controller for this domain. DNS again.

5 — access denied. Often a machine account password mismatch, or the DC's own computer account has a problem.

8456 / 8457 — source or destination server is currently rejecting replication requests. Frequently seen while a DC is still performing initial sync after promotion.

If you see 8524 or 1908, go look at DNS before anything else. Specifically check that each DC has the _msdcs subdomain delegated correctly and that every DC's host record is present.

FORCING REPLICATION WHEN YOU'VE FIXED THE CAUSE

Once the underlying problem is resolved, don't wait for the next scheduled cycle:

powershell

# Force all partitions to sync across all partners, with push
repadmin /syncall /AdeP

# Or from one specific DC
Sync-ADObject -Object "CN=SomeUser,OU=Users,DC=domain,DC=com" `
    -Source "DC01" -Destination "DC02"

Then confirm:

powershell

repadmin /replsummary

That gives you a table of every DC with its largest replication delta. It's the fastest sanity check available and worth running manually whenever you've touched anything network-related between sites.

SETTING UP TASK SCHEDULER

  1. Press Windows key → type Task Scheduler → open it

  2. Click "Create Basic Task" → name it AD Replication Monitor

  3. Trigger: Daily → 6:30am

  4. Action: Start a program

  5. Program: powershell.exe

  6. Arguments:

-ExecutionPolicy Bypass -File "C:\Scripts\ADReplicationMonitor.ps1"
  1. Click Next → Finish

Under Properties → General, check "Run with highest privileges" and run it as an account with replication read rights.

Daily is appropriate. Replication problems develop over hours to days, and the tombstone clock runs in months — you don't need minute-level granularity, you need to not miss it entirely for three weeks.

Run it from a DC or a management server with RSAT. If you have multiple sites, run it from wherever has the most reliable connectivity to all of them, since a WAN problem will show up as unreachable DCs rather than replication failures.

TEST IT

Run as administrator:

powershell

powershell.exe -ExecutionPolicy Bypass -File "C:\Scripts\ADReplicationMonitor.ps1"

Before trusting it, get the baseline from the built-in tools:

powershell

repadmin /replsummary
repadmin /showrepl * /csv | ConvertFrom-Csv | Format-Table
dcdiag /test:replications

If repadmin /replsummary shows all zeros in the largest-delta column, you're healthy and the script should agree.

To check tombstone lifetime directly:

powershell

$configNC = (Get-ADRootDSE).configurationNamingContext
(Get-ADObject -Identity "CN=Directory Service,CN=Windows NT,CN=Services,$configNC" `
    -Properties tombstoneLifetime).tombstoneLifetime

If that returns nothing, the attribute isn't explicitly set and the default applies — 180 days for domains created on Server 2003 SP1 or later, 60 for anything older that was upgraded in place.

IF YOU FIND A DC PAST TOMBSTONE

Be clear-eyed about this one: there is no supported way to bring it back.

Do not be tempted by registry workarounds that disable replication consistency checking. They exist, they technically work, and they will reintroduce lingering objects — deleted objects that come back to life on one DC and propagate. That's a worse problem than the one you started with, and it's genuinely difficult to clean up afterward.

The supported path:

  1. Demote the DC, forcibly if it won't demote cleanly: dcpromo /forceremoval

  2. Clean up the metadata on a healthy DC with ntdsutil metadata cleanup, or via Remove-ADDomainController with the appropriate switches

  3. Remove the leftover records — DNS entries, the computer object, the NTDS Settings object in Sites and Services

  4. Rebuild and re-promote

It's a half-day job done properly. The entire purpose of this script is making sure you never have to do it.

WHY THIS MATTERS

Replication failure is the rare infrastructure problem with a hard expiry date on the fix. Most things degrade and stay fixable. This one has a cliff, and the cliff is months away which is exactly long enough for everyone to forget about it.

It's also invisible by design. AD is built to keep serving from local data when it can't reach a partner, because that's the right behaviour for a distributed directory. The resilience that keeps authentication working is the same resilience that hides the problem.

A daily email with a days-remaining number turns a silent countdown into something with a deadline attached.

THIS WEEK'S ACTION

Run repadmin /replsummary on a DC right now — it takes about ten seconds. If the largest-delta column shows anything beyond a few minutes, run the full script and look at the tombstone percentage. You want to know that number before it knows you.

Reply to this email if you hit any issues — I read every reply.

Automate & Operate — automateandoperate.com

Why are so many brands shifting ad spend to CTV?

People spend more time streaming than they do with cable, social media or video games, and advertisers know it. In fact, according to Advertiser Perceptions and Premion's 2026 CTV/OTT Advertiser Survey, 70% of advertisers are raising CTV budgets in 2026, with much of that budget diverted from social advertising.

For marketers who want a presence in streaming, Roku is the obvious place to go, with scale that speaks for itself. With more than 100 million households representing 47% of all streaming time in the US, Roku easily has more reach than every competitor.

With Roku Ads Manager, you can reach viewers across more than 100 premium apps in a single buy. Combine your customer data with Roku's insights to reach only the households you want, then measure and optimize to your heart's content.

Want to give it a try? Unleash your first campaign in just four steps: (1) Create your account, (2) define your objective and target audience, (3) upload creative, and (4) launch.

First-time spenders get a $5,000 match on the first $5,000 spent with code BEEHIIV5K. Terms apply.