Alexander's Blog

Sharing knowledge with the global IT community since November 1, 2004

How to Configure Your Windows Server to Use an External Time Source

/
/
ad-mania

Having the same time on all your Windows servers is extremely important. Microsoft Exchange, SQL Server, and Active Directory all rely on the Time Service (W32Time). The Kerberos authentication protocol in Windows also relies on the Time Service and if the time is out of sync on the servers, you can have some serious issues.

By default, the Windows computers use the following hierarchy to synchronize time with the servers.

  1. All client desktop computers synchronize time with the authenticating domain controller.
  2. All member servers also synchronize time with the authenticating domain controller.
  3. All domain controllers in a domain synchronize time with the primary domain controller (PDC) operations master.
  4. All PDC operations masters in each domain synchronize time with the PDC operations master in the forest root domain.

Microsoft recommends that you configure the authoritative time server to obtain the time from a hardware source because when you configure the authoritative time server to sync with an Internet time source there is no authentication. However, there are pros and cons to both using a hardware source and an Internet time source. Organizations often choose to synchronize time with an Internet time source because it is free and convenient. Here’s how you can configure a Windows Server to use an external time source on the Internet.

Step 1 –  Change the Server Type to NTP

  1. Start Registry Editor and go to the following location:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters\Type
  2. Double-click Type and change the value to NTP.
  3. Click OK.

Step 2 – Enable NTP Server

  1. Locate the following location in the registry:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpServer
  2. Double-click Enabled, type 1 and click OK.

Step 3 -Specify the Time Sources

  1. Go to the following location in the registry:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters
  2. Double-click NtpServer and enter the following:
    us.pool.ntp.org,0×1
    You can list more than one time sources here. Use spaces to separate them. The important thing to remember is to add ,0x1 at the end of each DNS name. For more information check out Microsoft’s KB article 262680: A list of the Simple Network Time Protocol (SNTP) time servers that are available on the Internet.
  3. Click OK.

Step 4- Configure the Time Correction Settings

  1. Go to the following location in the registry:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config\MaxPosPhaseCorrection
  2. Double-click MaxPosPhaseCorrection and enter a decimal value in seconds. For example, for 30 minutes type 1800, for one hour type 3600 and then click OK.
  3. Go to the following key in the registry:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config\MaxNegPhaseCorrection
  4. Double-click MaxNegPhaseCorrection and enter a decimal value in seconds. For example, for 30 minutes type 1800, for one hour type 3600 and then click OK.

Step 5 -Modify the Poll Interval

  1. Go to the following location in the registry:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient\SpecialPollInterval
  2. Double-click SpecialPollInterval and change the value to 900 and then click OK. This value sets the time in seconds so by setting it to 900 you are configuring the time server to poll every 15 minutes.

Step 6 – Restart Windows Time Service

  1. Go to the command prompt and type the following command.
    net stop w32time && net start w32time

You just configured your server to automatically synchronize time with an Internet source. If you ever want to manually synchronize the time just type W32tm /resync at the command prompt.



I have tested this procedure successfully on Windows Server 2012 Datacenter, Windows Server 2008 R2 Enterprise and Windows Server 2003 R2 Enterprise. For more information and to configure the Windows time service to use an internal hardware clock, check out this KB article.


Copyright ©2013 Zubair Alexander. All rights reserved.

  • Facebook
  • Twitter
  • Linkedin

Leave a Comment

Your email address will not be published. Required fields are marked *

This div height required for enabling the sticky sidebar