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

Leave Your Comment

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

Please add 5 and 7 and type the answer here:

Preview Your Comment.