SNTP

From wiki.adammorgan.org
Jump to: navigation, search

General

The "simple" version of Network Time Protocol, used by Windows Domains to keep time synced on workstations. Since domain controllers are SNTP servers by default, they're also great for syncing network devices like switches.

Windows Commands

  • Net Time - Technet command reference
    • An older, officially deprecated command library that's been replaced W32tm.
    • Display the name of the Network Time Protocol (NTP) server currently configured for the local computer or the one specified in ComputerName:
      net time /querysntp
    • To disable the use of any external NTP server (to return to the original configuration), enter this command (i.e., without any colon or named server):
      net time /setsntp
  • W32tm.exe is used to configure Windows Time service settings, and is built-in to Windows XP, Windows Vista, Windows 7, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, and Windows Server® 2008 R2 default installations.
    • Display local computer's time source
      w32tm /query /source
    • Display another computer's time source (Vista and later)
      w32tm /query /computer:mydomainname\COMPUTERNAME /source

Windows Server 2003: force to sync with domain controller

  • If a server is incorrectly syncing to an external time server, you can fix it with this:
w32tm /config /syncfromflags:domhier /update

Windows Server 2008: How to sync to an external time server (may not be best way, worked for me once)

  • NOTE: You should only do this on your domain's PDC (primary domain controller)! Other domain controllers will automatically sync time with the PDC, and domained computers will automatically sync time to their local DC.
  • From an elevated command prompt:
net stop w32time
w32tm /config /syncfromflags:manual /manualpeerlist:"us.pool.ntp.org"
The command completed successfully.
net start w32time
The Windows Time service is starting...
The Windows Time service was started successfully.
  • You can verify that it's working with this command:
w32tm /query /configuration