Check time source for all Domain Controllers
I was recently working on an issue for a customer who was noticing random time sync issues on various DC’s. I needed to confirm that all servers were set to point to the PDC for their time source. I’ve put together this basic script which does just that:
$DomainControllers = Get-ADDomainController -Filter * | Select-Object -expand name
foreach ($DomainController in $DomainControllers)
{
write-host “———————————————–”
write-host “Domain Controller: $DomainController”
write-host “Time Source:”
w32tm /query /computer:$DomainController /source
write-host “———————————————–”
}