Windows server 2008 / 2008 R2 AD sync with external NTP server

As AD servers provide time to machines in a domain it is important to have AD servers synchronized with an realyable time source. If you know the project http://pool.ntp.org you can find NTP servers that are part of this “cluster” and are near to you. As I live in Slovenia we have a pool called si.pool.ntp.org in which you can find Slovenian NTP servers that are accurate enough to provide exact time (for those more familiar with NTP protocol in pool there you can find also most accurate stratum1 and stratum2 time servers…).

On AD server that is running Windows server 2008 / 2008 R2 you should run command prompt with administrative rights (right click / run as administrator).

First check difference between your server and external time source (in my example si.pool.ntp.org)

Command: w32tm /stripchart /computer:si.pool.ntp.org /samples:5 /dataonly

Example:
C:>w32tm /stripchart /computer:si.pool.ntp.org /samples:5 /dataonly
Tracking si.pool.ntp.org [194.249.198.37:123].
Collecting 5 samples.
The current time is 24.6.2011 13:29:08.
13:29:08, +08.8351541s
13:29:10, +08.7976694s
13:29:12, +08.8065559s
13:29:14, +08.7534768s
13:29:16, +08.7956427s

Confiure your server to use external NTP time source for sync:

Command: w32tm /config /manualpeerlist:si.pool.ntp.org,0x8, /syncfromflags:manual /update

Example:
C:>w32tm /config /manualpeerlist:si.pool.ntp.org,0x8, /syncfromflags:manual /update
The command completed successfully.

Force sync immediately:
Command: w32tm /resync

Example:
C:>w32tm /resync
Sending resync command to local computer
The command completed successfully.

I will now retry the first command to see the results:

C:>w32tm /stripchart /computer:si.pool.ntp.org /samples:5 /dataonly
Tracking si.pool.ntp.org [193.2.111.2:123].
Collecting 5 samples.
The current time is 24.6.2011 13:19:20.
13:19:20, +00.0485657s
13:19:22, +00.0415741s
13:19:24, +00.0380984s
13:19:26, +00.0342493s
13:19:28, +00.0310221s

18 thoughts on “Windows server 2008 / 2008 R2 AD sync with external NTP server

  1. Benjamin

    Hvala Luka za ta nasvet! Na ta način lahko beležim razhajanje časa v datoteko in pozneje analiziram dogajanje.
    Ukaz preverjeno deluje tudi na XP in na Server 2003.

    Like

    Reply
  2. Azam Ali

    Excellent post sir. It worked on the Server fine but i had to do this on one of the PC’s.

    Resync time server on windows 7 PC
    Net stop w32time
    W32tm/unregister
    W32tm/register
    Net start w32time
    W32tm /resync

    By the time i was finished researching and doing one PC, all the other PC’s had updated their time.

    So i would say if you are in a hurry use above but if you leave it for an hour the domain will update itself.

    Like

    Reply
  3. s7hr3oo0m

    From the looking at the post time differences and then some personal testing the error that you are getting seems to be that the 0x8 is a subjective value. In the post the time was off by +08.8351541s. when i was testing this out my time was off by +7225.8372654s therefore i used 0x7225 to fix the issue…

    Like

    Reply
  4. Horacio-UY

    Hello. i tried
    w32tm /stripchart /computer:si.pool.ntp.org /samples:5 /dataonly and i get the message: Error Host desconocido (0x80072AF9)

    Do you know what happens???

    Like

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s