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,0×8, /syncfromflags:manual /update

Example:
C:\>w32tm /config /manualpeerlist:si.pool.ntp.org,0×8, /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 Responses to “Windows server 2008 / 2008 R2 AD sync with external NTP server”

  1. firefly2000uk says:

    Cheers for the post. Just what I needed! Synced with pool.ntp.org and clock changed straightaway.

  2. Benjamin says:

    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.

  3. David says:

    Thank you!

  4. moses says:

    Thank you!

  5. Azam Ali says:

    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.

  6. Reiko says:

    Hvala!

  7. FRANK says:

    Thank you! Worked perfectly.

  8. Ricardo says:

    Thanks and Regards from Portugal

  9. enoola says:

    awesome thanks for the time spent writing this article, REALLY useful.
    from France ;)

  10. Mick says:

    I get a message: “The following arguments were unexpected: 0×8″ message. Any ideas?

  11. s7hr3oo0m says:

    From the looking at the post time differences and then some personal testing the error that you are getting seems to be that the 0×8 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 0×7225 to fix the issue…

  12. Horacio-UY says:

    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???

  13. Horacio-UY says:

    Hello..forget the answer.. i found my error…tks… great article!!!
    From uruguay, south-america

  14. Andy says:

    Great article – worked straight away! Thanks!

  15. It worked like a charm, thank you very much!

  16. Cannan says:

    We use http://nts.softros.com as server (on all DCs with also around 0.005 accuracy) and its client — good tool also if you have a budget for that. Greeting from Amsterdam :)

  17. Dudu says:

    it worked !!!!!
    thanks

  18. Rob Gibson says:

    Love this post. Best and most simple on the internet that I’ve found in a few years.

Leave a Reply