Link to home
Start Free TrialLog in
Avatar of kyle972
kyle972

asked on

Synchronize Windows Server 2008 R2 System Time with time servers

I need to synchronize my server time with three internet time servers.

Time Servers:
209.133.24.7
65.164.7.70
65.164.7.71

I also need to synchronize the time every hour.

I am operating windows server 2008 R2. It is a VPS.
ASKER CERTIFIED SOLUTION
Avatar of brian_vt_hokie
brian_vt_hokie
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kyle972
kyle972

ASKER

Thanks. How often will Windows check and resync them?
Avatar of Adam Brown
The time period is set in seconds in the HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ W32Time \ TimeProviders \ NtpClient \SpecialPollInterval key and is 7 days by default. Not that the time syncs automatically every time the W32Time service starts, so it will sync at reboot automatically.
The key point is the PDC emulator syncronizes time for the entire forrest. So make sure your pdc is pointed to a valid ntp server. Check the link for the closest location.

http://tycho.usno.navy.mil/ntp.html
Multiple NTP servers are surrounded by quotes, space delimited... therefore, the following command

NET TIME /SETSNTP:"209.133.24.7 65.164.7.70 65.164.7.71"  Is what you likely want.
Make sure you do this ONLY on the PDC emulator, other domain members will follow the PDC emulator.

Also, you noted that this is a "VPS" - if you mean virtual, make sure the host isn't overriding timesync (as most of the hypervisors do).  As far as syncing every hour, that's overkill unless your PC clock is WAY off.  Microsoft's NTP is a gradual adjustment tool.

Check your Event Viewer logs for W32Time happiness factors.
Avatar of kyle972

ASKER

It appears the VPS host is overriding the timesync. The VPS is Windows Server 2008 R2 Hyper-V. How do I disable the automatic timesync to the host?
VMs will automatically sync with the host they are on and there isn't a way to disable that functionality. You can disable the automatic VM time sync function, but it will still sync with the host on reboot. This is because Hyper-V syncs time through the Virtual BIOS of each system rather than through the Windows Time Service. Your best bet is to ensure that your VM Host is syncing with the PDC. Running the second attached command in the command prompt will configure this for you. It should already be set that way, though. If your PDC is a VM, run the first command on the VM host and it will configure that system to sync with an external time source (Change the value after /manualpeerlist: to use a different time server if you like). With the VMs syncing to the VM Host and the VM Host syncing to a reliable time server, the time of your VMs should then be accurate.
w32tm /config /manualpeerlist:nist.time.gov /syncfromflags:manual

Open in new window

w32tm /config /syncfromflags:domhier

Open in new window

VMs do not automatically sync time with the host in Hyper-V. This is a configurable setting. Time synch with the host os is done through the Time Synchronization integration component (IC) and this can be disabled. To disable this, go to the settings of the VM and then go to the Management section > Integration services. Uncheck Time synchronization.

However... what I usually prefer doing if the PDC is a VM is setting the authoritative time source on the Hyper-V Host OS and then keep the VM Time Synch IC. The PDC will still be getting the updated time - just through one more step in the Hyper-V server.

Keeping the time synchronization IC enabled is the preferred method. It enables the Guest OS to have time synch during startup of the VM and for snapshots (which you should not use for DCs)