Tuesday, December 13, 2011

Configure automatic date and time synchronization on Windows Server 2008 R2

If you like to see your Windows Server 2008 R2 automatically syncing it’s date and time settings, do following:

  • Start console as administrator
  • Stop the service

    net stop w32time

    image
  • Run

    w32tm /config /syncfromflags:MANUAL /manualpeerlist:<list of NTP servers>

    image
    For list of public NTP servers please refer to: http://support.ntp.org/bin/view/Servers/NTPPoolServers
    We use 0.europe.pool.ntp.org to 3.europe.pool.ntp.org
  • Start the service again

    net start w32time

    image
  • Check the system event log for successful configuration:

    The time provider NtpClient is currently receiving valid time data from 0.europe.pool.ntp.org,1.europe.pool.ntp.org (ntp.m|0x1|0.0.0.0:123->85.236.42.140:123).

    image

From now your server will sync the date and time settings automatically.

You can update the configuration of the local time service also without service restart: just run

w32tm /config /update /syncfromflags:MANUAL /manualpeerlist:<list of NTP servers>

If you plan to let other boxes in your network segment sync their date and time settings with the setting of this box, you have to configure the time service on this box as reliable:

w32tm /config /reliable:yes

For more options refer to Microsoft article:
http://technet.microsoft.com/en-us/library/cc773263%28WS.10%29.aspx

Enjoy!

UPD: here the script sample to copy/paste. ATTENTION “w32tm /config…” is one line – remove evtl. line breaks after copy

rem stop w32time
net stop w32time
rem config service
w32tm /config /syncfromflags:MANUAL /manualpeerlist:0.europe.pool.ntp.org,1.europe.pool.ntp.org,2.europe.pool.ntp.org,3.europe.pool.ntp.org
rem restart w32time
net start w32time

2 comments:

Anonymous said...

How can I change back to original setting?

winmike said...

Depens upon what you mean with original settings? check out MS TechNet article and select the most suitable setting