Skip to content

Windows Server Time Synchronization and NTP Configuration

This article explains how time synchronization works in a Windows Server domain and how to configure NTP using PowerShell.
It focuses on designing around the PDC Emulator as the reference clock, configuring the w32time service, standardizing settings via Group Policy, and key considerations for virtualized environments.


VariableExampleDescription
<<PDC_HOST>>DC01.contoso.localPDC Emulator (domain time reference)
<<SECONDARY_DC>>DC02.contoso.localAdditional domain controller
<<NTP_SERVER>>ntp.nict.jpExternal NTP server (hostname or IP)
<<CLIENT_HOST>>SRV01.contoso.localMember server or client
<<DOMAIN_NAME>>contoso.localActive Directory domain name

Active Directory uses a hierarchical time model:

TierSync SourceNotes
PDC EmulatorExternal NTPSingle authoritative time source for the forest/domain
Other DCsPDC EmulatorMaintain domain-wide time consistency
Members/ClientsNearest DCAuto-sync for Kerberos tolerance and consistency

In workgroup scenarios, each machine must be configured manually to use an external NTP source.


Step 2: Configure the PDC Emulator with External NTP

Section titled “Step 2: Configure the PDC Emulator with External NTP”

Set the PDC Emulator as the domain’s only reliable time source.

Terminal window
# Configure external NTP servers (multiple allowed)
w32tm /config /manualpeerlist:"ntp.nict.jp time.google.com" /syncfromflags:manual /reliable:yes /update
# Advertise as a reliable time source
reg add HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Config /v AnnounceFlags /t REG_DWORD /d 5 /f
# Restart the time service
net stop w32time && net start w32time

Verify:

Terminal window
w32tm /query /configuration
w32tm /query /status

Step 3: Configure Other DCs and Members to Follow the Domain

Section titled “Step 3: Configure Other DCs and Members to Follow the Domain”

Other DCs and domain members normally follow the PDC automatically. You can enforce it explicitly:

Terminal window
# Follow domain hierarchy
w32tm /config /syncfromflags:domhier /update
net stop w32time && net start w32time

Force a sync and check status:

Terminal window
w32tm /resync /force
w32tm /query /status

Step 4: Standardize Time Settings via GPO (PowerShell-Only Workflow)

Section titled “Step 4: Standardize Time Settings via GPO (PowerShell-Only Workflow)”

Use Group Policy (GPO) to enforce time settings across the domain without using any GUI.


1) Load GPO Module and Inspect Existing Policies

Section titled “1) Load GPO Module and Inspect Existing Policies”
Terminal window
Import-Module GroupPolicy
# List GPOs
Get-GPO -All | Select-Object DisplayName, Id, GpoStatus
# Confirm the Default Domain Policy exists
Get-GPO -Name "Default Domain Policy" | Select-Object DisplayName, ModificationTime

Terminal window
# If not found, the value is simply not configured yet
Get-GPRegistryValue -Name "Default Domain Policy" `
-Key "HKLM\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpClient" `
-ValueName Type
Get-GPRegistryValue -Name "Default Domain Policy" `
-Key "HKLM\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpClient" `
-ValueName NtpServer

A “not found” error here just means the setting hasn’t been defined in the GPO.


Terminal window
# Enable NTP client
Set-GPRegistryValue -Name "Default Domain Policy" `
-Key "HKLM\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpClient" `
-ValueName Enabled -Type DWord -Value 1
# Sync mode (NT5DS = domain hierarchy, NTP = external peers)
Set-GPRegistryValue -Name "Default Domain Policy" `
-Key "HKLM\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpClient" `
-ValueName Type -Type String -Value "NT5DS"
# External NTP server (PDC only)
Set-GPRegistryValue -Name "Default Domain Policy" `
-Key "HKLM\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpClient" `
-ValueName NtpServer -Type String -Value "<<NTP_SERVER>>,0x8"
# Optional: polling interval (seconds)
Set-GPRegistryValue -Name "Default Domain Policy" `
-Key "HKLM\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpClient" `
-ValueName SpecialPollInterval -Type DWord -Value 3600

Terminal window
# Export an HTML report for linkage/scope review
Get-GPOReport -Name "Default Domain Policy" -ReportType Html -Path "$env:TEMP\DefaultDomainPolicy.html"

Terminal window
# Apply immediately
gpupdate /force
# Confirm applied policies
gpresult /r
# Generate a detailed HTML report
Get-GPResultantSetOfPolicy -ReportType Html -Path "$env:TEMP\gpresult.html"

Terminal window
reg query "HKLM\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpClient"

Example output:

Enabled REG_DWORD 0x1
Type REG_SZ NT5DS
NtpServer REG_SZ ntp.nict.jp,0x8
SpecialPollInterval REG_DWORD 0xe10

In Hyper-V/VMware environments, host and guest time sync can conflict:

Common triggers:

  • Both host and VM time synchronization enabled
  • PDC Emulator runs as a VM with a different NTP source
  • Snapshots or live migrations causing time rollback/drift

Recommendations:

  • Disable host time sync on the PDC Emulator
  • Allow host time sync on other VMs if desired
  • Ensure DC-to-DC synchronization relies solely on w32time

Terminal window
# NTP reachability/offset test
w32tm /stripchart /computer:"<<NTP_SERVER>>" /dataonly /samples:5
# Service state
Get-Service w32time
# Last 10 Time Service events
Get-WinEvent -LogName System | Where-Object { $_.ProviderName -eq "Microsoft-Windows-Time-Service" } |
Select-Object TimeCreated, Id, LevelDisplayName, Message -First 10

  • The PDC Emulator is the domain’s single authoritative time source.
  • Only the PDC should use external NTP; others follow domhier.
  • In virtual environments, disable host time sync on the PDC to avoid conflicts.