Tuesday, October 4, 2011

What time is it?

Digging about Windows features a bit, I found Windows could also be used as an NTP server, and since I’ve been working on a native Windows environment lately, those are great news :)

Among other ways, there are two main ways Windows could set a remote clock:

  1. Via DC - If remote computer is in a domain, the DC (Domain Controller) is responsible of setting the time
  2. Via DHCP – if the remote machine has an active DHCP client, Windows can also send the clock via internal clock or fetch the time from a remote NTP server and return the current time to the remote machine.

This article is divided into two groups:

  • Windows 2000
  • Windows XP/Vista/2003/2008/7

The reason for this division is because Microsoft had changed the Windows Registry values since Windows 2000 (XP and up has much more granularity now), and that using XP and up machines with a Domain Controller turns on this feature by default.

Configuring Windows 2000 to act as an NTP server
  1. Click Start, click Run, type regedit, and then click OK.
  2. Locate and then click the following registry subkey:

    HKEY LOCAL MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters

  3. In the right pane, right-click ReliableTimeSource, and then click Modify.
  4. In Edit DWORD Value, type 1 in the Value data box, and then click OK.
  5. Locate and then click the following registry subkey:

    HKEY LOCAL MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters

  6. In the right pane, right-click LocalNTP, and then click Modify.
  7. In Edit DWORD Value, type 1 in the Value data box, and then click OK.
  8. Quit Registry Editor.
  9. At the command prompt, type the following command to restart the Windows Time service, and then press ENTER:

    net stop w32time && net start w32time

  10. Run the following command on all the computers other than the Time Server to reset the local computer's time against the Time Server:

    w32tm –s

Configuring Windows Windows XP/Vista/2003/2008/7 to act as an NTP server
  1. Create a text file and the file format to reg
  2. Open the file in notepad and copy the following:

    Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\W32Time\TimeProviders\NtpServer]
    "Enabled"=dword:00000001

  3. Save the file and execute it
  4. At the command prompt, type the following command to restart the Windows Time service, and then press ENTER:
  5. net stop w32time && net start w32time
  6. Run the following command on all the computers other than the Time Server to reset the local computer's time against the Time Server:
  7. w32tm –s

More information could be found in the below links from Microsoft:

Windows 2000

Windows XP/Vista/2003/2008/7

Have fun ^_^

No comments:

Post a Comment