How to Setup a Windows 2008 R2 SNTP/NTP Server

Gee, setting up an SNTP/NTP server in Windows is not intuitive.

The good news is: When configured correctly, you can use the Windows Time (W32Time) service as an SNTP/NTP server for both windows and non-windows SNTP/NTP clients.

Here's how to do it:

  1. Click Start, click Run, type regedit, and then click OK.
  2. Locate and then click the following registry entry:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config\

  3. In the right pane, right-click AnnounceFlags, and then click Modify.
  4. In the Edit DWORD Value dialog box, under Value data, type 5, and then click OK.
  5. Enable NTPServer.
    1. Locate and then click the following registry subkey:

      HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\
                                                      Services\W32Time\TimeProviders\NtpServer\

    2. In the right pane, right-click Enabled, and then click Modify.
    3. In the Edit DWORD Value dialog box, type 1 under Value data, and then click OK.
  6. Exit Registry Editor.
  7. At the command prompt, type the following command to restart the Windows Time service, and then press ENTER:

    net stop w32time && net start w32time

This should get you setup with minimal registry hack impact.

Tips

  • Make sure W32Time is set to Automatic startup mode.
  • Make sure UDP 123 is allowed through your firewall.
  • Use this InternetTime program to help you debug connectivity to your SNTP/NTP server.

Hope that helps,
Brian Chavez
37 Comments Filed Under [ Tips & Tricks ]

Comments

# re: How to Setup a Windows 2008 R2 SNTP/NTP Server
Gravatar Hi, why do you not just use the "net time /setsntp:servername" command to enter the new SNTP server?

Bye
Michel
Left by Michel on 2/26/2010 11:45 AM
# re: How to Setup a Windows 2008 R2 SNTP/NTP Server
Gravatar Worked beautifully! Thanks for the great post with quick and clear instructions.
Left by EvilEmuofDoom on 2/27/2010 12:20 PM
# re: How to Setup a Windows 2008 R2 SNTP/NTP Server
Gravatar @Michel

Because this command isn't available anymore in Windows 2008 R2?
Left by verypsb on 3/4/2010 10:08 PM
# re: How to Setup a Windows 2008 R2 SNTP/NTP Server
Gravatar More info: How to configure an authoritative time server in Windows Server
http://support.microsoft.com/kb/816042
Left by verypsb on 3/4/2010 10:18 PM
# re: How to Setup a Windows 2008 R2 SNTP/NTP Server
Gravatar I can make a 2008 Server do one or the other , but not both at once.

It appears that if
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config\AnnounceFlags

Is set to a it will be set as a NTPClient to receive time from a valid NTP
Event Viewer
The time provider NtpClient is currently receiving valid time data from time.windows.com,0x9 (ntp.m|0x9|0.0.0.0:123->65.55.21.23:123).
The time service is now synchronizing the system time with the time source time.windows.com,0x9 (ntp.m|0x9|0.0.0.0:123->65.55.21.23:123).

Is set to 5 it will be set as a NTPServer to advertise a valid NTP
Event Viewer
The time service has started advertising as a time source.
The time service has started advertising as a good time source.


What I need is a way that a and 5 are combined.

Left by Steve on 3/1/2012 7:06 AM
# re: How to Setup a Windows 2008 R2 SNTP/NTP Server
Gravatar Using built-in commands:

w32tm /config /syncfromflags:manual /manualpeerlist:europe.pool.ntp.org /reliable:yes /update

w32tm /resync

...where europe.pool.ntp.org is your preferred time (NTP) server. I find NTP.org more reliable than time.windows.com which is probably overloaded because it was the default in Windows desktop versions for a long time.

Didn't need to add a firewall exception, was probably included in the Active Directory Services or File Server roles I added. Otherwise of course UDP 123 outgoing would have to be enabled.

Most important is setting the syncfromflags to manual otherwise you are not allowed to use an external time source.

The best practice should be using default workstation to domain to forest root sync hierachy, and only performing these steps on the forest root server(s) to get the atomic time from an external source, then the whole domain has atomic time with minimal settings and maximum defaults (minimum maintenance effort).
Left by Tony Wall on 3/6/2012 12:52 PM
# re: How to Setup a Windows 2008 R2 SNTP/NTP Server
Gravatar ah
Left by ahmad zia on 5/5/2012 3:01 AM
# re: How to Setup a Windows 2008 R2 SNTP/NTP Server
Gravatar also work perfectly for windows 2003 server...
Left by Abdullah on 5/8/2012 4:24 AM
# re: How to Setup a Windows 2008 R2 SNTP/NTP Server
Gravatar tnx alot
worked correctly
for all windows and non-windows NTP clients
Left by javad pourhosaini on 6/17/2012 3:56 AM
# re: How to Setup a Windows 2008 R2 SNTP/NTP Server
Gravatar Thanks Brian. Great instructions.
Left by rb122756 on 7/31/2012 8:39 AM
# re: How to Setup a Windows 2008 R2 SNTP/NTP Server
Gravatar thanks man, worked like a charm! :)
Left by korvarn on 9/21/2012 4:07 AM
# re: How to Setup a Windows 2008 R2 SNTP/NTP Server
Gravatar I have a server that pulls data from a production network but itself is connected to the domain/forest as well. I need to use that 2008 server to make sure the devices sending it data are in sync with it for data accuracy. Since it is not a domain controller or anything will making it an sntp/ntp cause any issues on the forest/domain side?
Left by SilverClawD on 11/8/2012 12:52 PM
# re: How to Setup a Windows 2008 R2 SNTP/NTP Server
Gravatar Worked perfest, Thanks.
Left by Botsha on 11/20/2012 3:55 AM
# re: How to Setup a Windows 2008 R2 SNTP/NTP Server
Gravatar If you set it on the standalone W2008 server (but domain joined) does it have any affect for its normal behavior when pulling time sync from the Domain Controller?

http://technet.microsoft.com/en-us/library/cc784191%28v=ws.10%29.aspx
Left by WinAdmin on 12/1/2012 7:15 AM
# re: How to Setup a Windows 2008 R2 SNTP/NTP Server
Gravatar Usually you need to add an exception in windows firewall on UDP port 123. By default it is closed.
Left by Mun on 12/3/2012 11:56 PM
# re: How to Setup a Windows 2008 R2 SNTP/NTP Server
Gravatar Great post Thanks!!!
Left by Diego Romero on 12/20/2012 5:46 AM
# re: How to Setup a Windows 2008 R2 SNTP/NTP Server
Gravatar Worked like a charm! thank you.
Left by ThankYou on 12/27/2012 3:48 AM
# re: How to Setup a Windows 2008 R2 SNTP/NTP Server
Gravatar It works! Thanks so much!
Left by An Pham on 1/4/2013 7:51 AM
# re: How to Setup a Windows 2008 R2 SNTP/NTP Server
Gravatar Works like a champ. Thanks!
Left by EJJ on 1/4/2013 9:58 AM
# re: How to Setup a Windows 2008 R2 SNTP/NTP Server
Gravatar I set it up to provide time to our Netgrae GS748Tv4 switch, but the switch only received the date, not the time. Is there a time zone setting to update?
Left by TG on 2/25/2013 6:08 AM
# re: How to Setup a Windows 2008 R2 SNTP/NTP Server
Gravatar Worked perfectly on Windows Server 2008 R2 SP1. Only clarification I would add is the W32Time service is named "Windows Time".
Left by RFSTech on 4/23/2013 11:16 PM
# re: How to Setup a Windows 2008 R2 SNTP/NTP Server
Gravatar You can set your network to sync time with the domain and/or your server in group policy. You can set how often it will sync. Most Admins create separate OU's for groups of PC or users. Set your servers to sync with an NTP service like time.windows.com or pool.ntp.org then set the PCs OU group policy to sync to the domain(Domain Controller) or the server if you use a workgroup. The method described here is much faster.
Left by Makinbacon on 5/16/2013 10:14 PM
# re: How to Setup a Windows 2008 R2 SNTP/NTP Server
Gravatar I cannot do the changes.
I got the server to pull the time from europe.pool.ntp.org by using the GUI.
There is no domain included and I would like for the rest of the network to pull the time of the windows 2008r2 server as having the same time is even more important that correct time, imho.

Usually you can pull the time from a DC with sntp/ntp.

When I try to use w32time or regedit to change any values I get - access denied.
I do have admin rights.

Any ideas ?

//T
Left by Tomten on 5/21/2013 4:24 AM
# re: How to Setup a Windows 2008 R2 SNTP/NTP Server
Gravatar Great Tips!!!

Left by Lee Wonseung on 6/21/2013 3:15 AM
# re: How to Setup a Windows 2008 R2 SNTP/NTP Server
Gravatar Setting up the NTP server easilly thank's to your explanation.
Our Azure Roles are now synchronized with this machine as secondary NTP server.
Thank's
Left by guillaume pelletier on 7/16/2013 10:12 AM
# re: How to Setup a Windows 2008 R2 SNTP/NTP Server
Gravatar Mr.Brian Chavez,
Thank you great article.

Left by Vijay on 7/18/2013 3:47 AM
# re: How to Setup a Windows 2008 R2 SNTP/NTP Server
Gravatar Thanks, this did the trick. It really is not very intuitive.
Left by Dave on 7/29/2013 11:15 AM
# re: How to Setup a Windows 2008 R2 SNTP/NTP Server
Gravatar I do not have internet in my network and there is NTP server running on Domain Controller. How should I configure the Windows Server 2008 R2 to sync time with NTP server.
Please help.
Left by Siraj on 7/30/2013 11:24 PM
# re: How to Setup a Windows 2008 R2 SNTP/NTP Server
Gravatar greattttttttttttttttttt ;)
Left by h on 8/25/2013 8:28 PM
# re: How to Setup a Windows 2008 R2 SNTP/NTP Server
Gravatar thanks bro its working


thanks
Left by taha on 9/23/2013 9:58 AM
# re: How to Setup a Windows 2008 R2 SNTP/NTP Server
Gravatar How to configure a client ubuntu 10.04.2 with ntpdate, only ntpdate -d [IPSERVER]? for test, is compatible with w2k8 r2 vs ubuntu 10.04.02?
Left by Ariel Gonzalez on 11/8/2013 7:43 PM
# re: How to Setup a Windows 2008 R2 SNTP/NTP Server
Gravatar Awsome! this worked. Thanks
Left by cisco guy on 11/13/2013 3:40 PM
# re: How to Setup a Windows 2008 R2 SNTP/NTP Server
Gravatar This is actually a very great help. I was able to setup one of our servers with this procedure. From there I added the 004 option in our AD DHCP along with an OU policy. This also keeps our Digital Clocks that are POE to the correct time. We have a couple around the library.
Left by PLanders on 11/22/2013 1:08 PM
# how many clients?
Gravatar Thanks for great guide.

I wan to know, how many client can use this kind of NTP server that rub by W32time? is there any limitation for usage?

thanks in advanced
Left by reza on 2/12/2014 2:27 AM
# re: How to Setup a Windows 2008 R2 SNTP/NTP Server
Gravatar Thank you very much great work appreciated..... highly...
Left by KSA on 4/1/2014 12:08 PM
# re: How to Setup a Windows 2008 R2 SNTP/NTP Server
Gravatar It worked perfectly....thank you!
Left by cherry on 6/23/2014 7:01 PM
# re: How to Setup a Windows 2008 R2 SNTP/NTP Server
Gravatar Great tips
working very good
Left by Mohammed Zayan on 7/2/2014 1:44 AM

Leave Your Comment

Title*
Name*
Email (never displayed)
 (will show your gravatar)
Url
Comment*

Please add 4 and 1 and type the answer here:

Preview Your Comment.