Pages

søndag 27. juli 2014

Windows: Time Synchronization

Hyper-V Integration Services synchronizes the time of virtual machines with the physical host because virtual machines tend to experience time drift over time. Never disable Hyper-V Time Synchronization, it's important when the virtual machine boots and resumes saved states.

Benjamin Armstrong talk about this topic in more detail in his Virtualization Blog. Here are some of the PowerShell commands I use to configure Time Synchronization in a domain.

# If the computer is a virtual machine running in Hyper-V, disable aspects of time synchronization from Hyper-V with:
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\VMICTimeProvider' -Name 'Enabled' -Value 0

# For the Domain Controller holding the PDC emulator role (chech with netdom /query fsmo), configure a remote time source:
& C:\Windows\System32\w32tm.exe /config /manualpeerlist:"0.no.pool.ntp.org,0×1 1.no.pool.ntp.org,0×1 3.no.pool.ntp.org,0×1 4.no.pool.ntp.org,0×1" /syncfromflags:manual /reliable:YES /update
Restart-Service w32time
& C:\Windows\System32\w32tm.exe /resync /rediscover

For member servers, configure synchronization with the domain:
& C:\Windows\System32\w32tm.exe /config /syncfromflags:DOMHIER /update
Restart-Service w32time
& C:\Windows\System32\w32tm.exe /resync /rediscover /force