Skip to main content
COSMICBYTEZLABS
NewsSecurityHOWTOsToolsStudyTraining
ProjectsChecklistsAI RankingsNewsletterStatusTagsAbout
Subscribe

Press Enter to search or Esc to close

News
Security
HOWTOs
Tools
Study
Training
Projects
Checklists
AI Rankings
Newsletter
Status
Tags
About
RSS Feed
Reading List
Subscribe

Stay in the Loop

Get the latest security alerts, tutorials, and tech insights delivered to your inbox.

Subscribe NowFree forever. No spam.
COSMICBYTEZLABS

Your trusted source for IT intelligence, cybersecurity insights, and hands-on technical guides.

429+ Articles
114+ Guides

CONTENT

  • Latest News
  • Security Alerts
  • HOWTOs
  • Projects
  • Exam Prep

RESOURCES

  • Search
  • Browse Tags
  • Newsletter Archive
  • Reading List
  • RSS Feed

COMPANY

  • About Us
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CosmicBytez Labs. All rights reserved.

System Status: Operational
  1. Home
  2. HOWTOs
  3. Active Directory Health Check: Comprehensive Diagnostic
Active Directory Health Check: Comprehensive Diagnostic
HOWTOIntermediate

Active Directory Health Check: Comprehensive Diagnostic

Run thorough health checks on Active Directory infrastructure including Domain Controllers, replication, DNS, SYSVOL, FSMO roles, and critical services...

Dylan H.

Systems Engineering

February 9, 2026
9 min read

Prerequisites

  • Domain Administrator or delegated diagnostic permissions
  • PowerShell 5.1+ with ActiveDirectory module
  • Remote Server Administration Tools (RSAT)
  • Network connectivity to all Domain Controllers

Overview

Active Directory is the backbone of enterprise identity and access management. Regular health checks are essential for maintaining authentication reliability, preventing replication failures, and catching issues before they cause outages.

Who Should Use This Guide:

  • Systems administrators managing AD environments
  • Security engineers validating domain controller integrity
  • IT operations teams performing pre/post-change validation
  • MSP technicians running proactive diagnostics

What You Will Learn:

AreaChecks Performed
Domain ControllersDCDiag comprehensive tests
ReplicationPartner status, lag detection, sync health
DNSRegistration, SRV records, scavenging
SYSVOLShare access, DFS-R state
FSMO RolesRole holder verification, connectivity
ServicesCritical AD service status
DatabaseNTDS.dit size, log file accumulation

Requirements

System Requirements

ComponentMinimum
PowerShell5.1+
RSATActive Directory tools installed
AccessDomain Admin or equivalent diagnostic permissions
NetworkConnectivity to all DCs on standard AD ports

Tools Referenced

  • dcdiag.exe — Domain Controller Diagnostics
  • repadmin.exe — Replication Administration
  • nltest.exe — Network Logon Test
  • PowerShell ActiveDirectory module

Part 1: Quick Health Summary

Comprehensive DCDiag Across All Domain Controllers

This script runs full diagnostics on every DC and generates a summary report:

<#
.SYNOPSIS
    Comprehensive AD Health Check — All Domain Controllers
.DESCRIPTION
    Runs DCDiag against every DC, generates a health report, and summarizes pass/fail counts
.NOTES
    Run from a domain-joined workstation with RSAT installed
#>
 
$ErrorActionPreference = 'Continue'
$ReportPath = "C:\BIN\LOGS-$(Get-Date -Format 'yyyy-MM-dd')-AD-HealthCheck.log"
 
# Get all Domain Controllers
$DCs = Get-ADDomainController -Filter * | Select-Object -ExpandProperty HostName
 
Write-Host "=== Active Directory Health Check ===" -ForegroundColor Cyan
Write-Host "Report: $ReportPath"
Write-Host "Domain Controllers: $($DCs.Count)"
Write-Host ""
 
# Run DCDiag on all DCs
foreach ($DC in $DCs) {
    Write-Host "Checking $DC..." -ForegroundColor Yellow
    dcdiag /s:$DC /v | Out-File -Append $ReportPath
}
 
# Summary
Write-Host ""
Write-Host "=== Summary ===" -ForegroundColor Green
Get-Content $ReportPath | Select-String "passed test|failed test" |
    Group-Object { $_ -match "passed" } |
    ForEach-Object {
        if ($_.Name -eq "True") { Write-Host "Passed: $($_.Count)" -ForegroundColor Green }
        else { Write-Host "Failed: $($_.Count)" -ForegroundColor Red }
    }

Quick Single-DC Check

For targeted diagnostics on a specific DC:

# Target specific DC — full verbose output
dcdiag /s:DC01.domain.local /v
 
# Essential tests only — faster execution
dcdiag /s:DC01.domain.local /test:services /test:replications /test:advertising /test:fsmocheck

DCDiag Test Reference

TestWhat It Checks
ConnectivityBasic DC network connectivity
AdvertisingDC is properly advertising its roles
FrsEventFile Replication Service event log errors
DFSREventDFS Replication event log errors
SysVolCheckSYSVOL is ready and accessible
KccEventKnowledge Consistency Checker errors
KnowsOfRoleHoldersFSMO role holder awareness
MachineAccountDC machine account health
NCSecDescNaming context security descriptors
NetLogonsNetlogon service privileges
ReplicationsReplication health and status
RidManagerRID pool availability
ServicesCritical AD service status
VerifyReferencesReference integrity

Part 2: Replication Health

Replication failures are one of the most common and impactful AD issues. Catch them early.

Check Replication Status

# Quick replication summary for all DCs
repadmin /replsummary
 
# Detailed replication status per DC
repadmin /showrepl
 
# Find replication failures — this is the critical check
repadmin /showrepl * /csv | ConvertFrom-Csv |
    Where-Object { $_.'Number of Failures' -gt 0 } |
    Format-Table 'Source DSA', 'Destination DSA', 'Number of Failures', 'Last Failure Status'
 
# Force replication sync across all partitions
repadmin /syncall /AdeP
 
# Show pending replication queue
repadmin /queue

Monitor Replication Partners

# Show all replication partners with last success time
Get-ADReplicationPartnerMetadata -Target * -Scope Domain |
    Select-Object Server, Partner, LastReplicationSuccess, LastReplicationResult |
    Format-Table -AutoSize
 
# Find partners with replication lag over 2 hours
Get-ADReplicationPartnerMetadata -Target * -Scope Domain |
    Where-Object { $_.LastReplicationSuccess -lt (Get-Date).AddHours(-2) } |
    Select-Object Server, Partner, LastReplicationSuccess

Repadmin Command Reference

CommandPurpose
/replsummaryQuick replication overview across all DCs
/showreplDetailed per-DC replication status
/syncall /AdePForce sync all partitions, all DCs
/showutdvecUp-to-dateness vector (version tracking)
/showobjmetaObject-level metadata for troubleshooting
/queuePending replication operations

Part 3: DNS Health

AD depends entirely on DNS. Broken DNS means broken authentication.

Verify DNS Registration

# Get all DCs
$DCs = (Get-ADDomainController -Filter *).HostName
$Domain = (Get-ADDomain).DNSRoot
 
foreach ($DC in $DCs) {
    Write-Host "DNS Check: $DC" -ForegroundColor Yellow
 
    # Verify A record resolves
    Resolve-DnsName $DC -Type A -ErrorAction SilentlyContinue
 
    # Verify critical SRV records exist
    Resolve-DnsName "_ldap._tcp.dc._msdcs.$Domain" -Type SRV
}
 
# Run DCDiag DNS-specific tests
dcdiag /test:dns /dnsdelegation
 
# Check DNS forwarders configuration
Get-DnsServerForwarder

DNS Scavenging Status

Stale DNS records can cause authentication failures and service outages:

# Check scavenging settings on DNS server
Get-DnsServerScavenging -ComputerName DC01
 
# Find stale records (older than 14 days)
Get-DnsServerResourceRecord -ZoneName "domain.local" -ComputerName DC01 |
    Where-Object { $_.Timestamp -and $_.Timestamp -lt (Get-Date).AddDays(-14) } |
    Select-Object HostName, RecordType, Timestamp |
    Format-Table -AutoSize

Part 4: SYSVOL and NETLOGON Health

SYSVOL stores Group Policy objects. If SYSVOL replication breaks, GPOs stop applying consistently.

Verify SYSVOL Share Accessibility

$DCs = (Get-ADDomainController -Filter *).HostName
 
foreach ($DC in $DCs) {
    $SYSVOLPath = "\\$DC\SYSVOL"
    $NETLOGONPath = "\\$DC\NETLOGON"
 
    Write-Host "Testing $DC..." -ForegroundColor Yellow
 
    if (Test-Path $SYSVOLPath) {
        Write-Host "  SYSVOL: OK" -ForegroundColor Green
    } else {
        Write-Host "  SYSVOL: FAILED" -ForegroundColor Red
    }
 
    if (Test-Path $NETLOGONPath) {
        Write-Host "  NETLOGON: OK" -ForegroundColor Green
    } else {
        Write-Host "  NETLOGON: FAILED" -ForegroundColor Red
    }
}
 
# Check DFS-R state
dfsrdiag.exe pollad

Part 5: FSMO Role Verification

Identify and Test FSMO Role Holders

# Method 1: netdom
netdom query fsmo
 
# Method 2: PowerShell — more detail
$Forest = Get-ADForest
$Domain = Get-ADDomain
 
Write-Host "=== Forest-Wide Roles ===" -ForegroundColor Cyan
Write-Host "Schema Master: $($Forest.SchemaMaster)"
Write-Host "Domain Naming Master: $($Forest.DomainNamingMaster)"
 
Write-Host ""
Write-Host "=== Domain-Wide Roles ===" -ForegroundColor Cyan
Write-Host "PDC Emulator: $($Domain.PDCEmulator)"
Write-Host "RID Master: $($Domain.RIDMaster)"
Write-Host "Infrastructure Master: $($Domain.InfrastructureMaster)"
 
# Test FSMO connectivity
foreach ($FSMO in @($Forest.SchemaMaster, $Domain.PDCEmulator, $Domain.RIDMaster)) {
    $HostName = $FSMO.Split('.')[0]
    if (Test-Connection $HostName -Count 1 -Quiet) {
        Write-Host "$FSMO : Online" -ForegroundColor Green
    } else {
        Write-Host "$FSMO : OFFLINE" -ForegroundColor Red
    }
}

Part 6: Critical Service Checks

Verify AD Services on All DCs

$ADServices = @(
    'NTDS',        # Active Directory Domain Services
    'DNS',         # DNS Server
    'Netlogon',    # Net Logon
    'DFSR',        # DFS Replication
    'W32Time',     # Windows Time
    'KDC'          # Kerberos Key Distribution Center
)
 
$DCs = (Get-ADDomainController -Filter *).HostName
 
foreach ($DC in $DCs) {
    Write-Host "=== $DC ===" -ForegroundColor Cyan
    foreach ($Service in $ADServices) {
        $Status = Get-Service -Name $Service -ComputerName $DC -ErrorAction SilentlyContinue
        if ($Status.Status -eq 'Running') {
            Write-Host "  $Service : Running" -ForegroundColor Green
        } else {
            Write-Host "  $Service : $($Status.Status)" -ForegroundColor Red
        }
    }
}

Check Event Logs for Recent Errors

$StartTime = (Get-Date).AddHours(-24)
 
foreach ($DC in $DCs) {
    Write-Host "=== $DC - Last 24h Errors ===" -ForegroundColor Yellow
 
    Get-WinEvent -ComputerName $DC -FilterHashtable @{
        LogName = 'Directory Service', 'DNS Server', 'DFS Replication'
        Level = 2  # Error
        StartTime = $StartTime
    } -MaxEvents 10 -ErrorAction SilentlyContinue |
    Format-Table TimeCreated, Id, Message -Wrap
}

Part 7: Database Health

Check NTDS Database Size and Log Files

$DCs = (Get-ADDomainController -Filter *).HostName
 
foreach ($DC in $DCs) {
    # NTDS.dit database size
    $NTDSPath = "\\$DC\c$\Windows\NTDS\ntds.dit"
    if (Test-Path $NTDSPath) {
        $Size = (Get-Item $NTDSPath).Length / 1GB
        Write-Host "$DC NTDS.dit: $([math]::Round($Size,2)) GB" -ForegroundColor Cyan
    }
 
    # Log file accumulation (many logs = potential backup issues)
    $LogPath = "\\$DC\c$\Windows\NTDS\*.log"
    $LogCount = (Get-ChildItem $LogPath -ErrorAction SilentlyContinue).Count
    $Color = if ($LogCount -gt 10) { 'Yellow' } else { 'Green' }
    Write-Host "$DC Log Files: $LogCount" -ForegroundColor $Color
}

Part 8: Time Sync Verification

Kerberos authentication fails if time drift exceeds 5 minutes between clients and DCs.

# Check time source on PDC Emulator
w32tm /query /source
 
# Check time offset against a DC
w32tm /stripchart /computer:DC01 /samples:5
 
# Force resync if needed
w32tm /resync /force
 
# Verify NTP configuration
w32tm /query /configuration

Troubleshooting

Common Issues and Resolutions

SymptomLikely CauseResolution
Replication failuresNetwork/DNS issuesCheck DNS, firewall rules, time sync
SYSVOL not replicatingDFS-R issuesRun dfsrdiag diagnostics, check DFS-R event log
Authentication delaysPDC unavailableVerify PDC connectivity and services
GPO not applyingReplication lagForce sync with repadmin /syncall /AdeP
DC not advertisingNTDS/Netlogon stoppedRestart services, check event logs
Kerberos failuresTime skew > 5 minFix NTP configuration on PDC Emulator
RID pool exhaustionRID Master offlineVerify RID Master, check RID pool allocation

Verification Checklist

  • DCDiag passes all tests on every DC
  • Replication shows no failures and lag under 15 minutes
  • DNS SRV records resolve correctly for all DCs
  • SYSVOL and NETLOGON shares accessible on all DCs
  • All five FSMO role holders online and responsive
  • Critical AD services running on all DCs
  • NTDS.dit size reasonable, log files not accumulating
  • Time sync within 1 second across all DCs
  • No critical errors in Directory Service event log (last 24h)

References

  • DCDiag Documentation
  • Repadmin Reference
  • AD Replication Troubleshooting
#Active Directory#PowerShell#Domain Controller#DNS#Replication#Windows Server

Related Articles

How to Detect and Block ClickFix Attacks

Learn how to detect and prevent ClickFix social engineering attacks using EDR rules, network monitoring, YARA signatures, and endpoint hardening. Covers...

14 min read

Domain Controller Hardening: Securing Active Directory

Comprehensive DC hardening guide covering tier model implementation, LDAP signing, NTLM restrictions, Kerberos hardening, AdminSDHolder, DSRM security,...

46 min read

Windows Server Hardening: Complete Security Guide for

Step-by-step Windows Server hardening covering CIS benchmarks, attack surface reduction, service hardening, firewall rules, credential protection, and...

43 min read
Back to all HOWTOs