Windows Time service tools and settings

Windows Time service tools and settings
  • Article
  • 30 minutes to check out

Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012, Windows 10, Azure Stack HCI, variations 21 H2 and 20 H2

The Windows Time service (W32 Time) integrates the date and time for all computer systems handled by Active Directory Domain Services (ADVERTISEMENT DS). This short article covers the various tools and settings utilized to handle the Windows Time service.

By default, a computer system that is signed up with to a domain integrates time through a domain hierarchy of time sources. If a computer system has actually been by hand set up to integrate from a particular time source, maybe since it was previously not signed up with to a domain, you can reconfigure the computer system to start instantly sourcing its time from the domain hierarchy.

Most domain-joined computer systems have a time customer kind of NT5DS, which suggests that they integrate time from the domain hierarchy. An exception to this is the domain controller, which operates as the main domain controller (PDC) emulator operations master for the root forest domain. The PDC emulator operations master in turn is generally set up to integrate time with an external time source.

You can accomplish down to one-millisecond time precision in your domain. For additional information, see Support limit for high-accuracy time and see Accurate Time for Windows Server 2016

Caution

Don’t utilize the Net time command to set up or set a computer system’s clock time when the Windows Time service is running.

Also, on older computer systems that run Windows XP or earlier, the Net time/ querysntp command shows the name of a Network Time Protocol (NTP) server with which a computer system is set up to integrate, however that NTP server is utilized just when the computer system’s time customer is set up as NTP or AllSync. This command has actually because been deprecated.

Network port

The Windows Time service follows the Network Time Protocol (NTP) spec, which needs making use of UDP port 123 for perpetuity synchronization. Whenever the computer system integrates its clock or supplies time to another computer system, it takes place over UDP port123 This port is solely booked by the Windows Time service.

Note

If you have a computer system with numerous network adapters (is multi-homed), you can not allow the Windows Time service based upon a network adapter.

You can utilize the command-line tool W32 tm.exe to set up Windows Time service settings and to detect computer system time issues. W32 tm.exe is the favored command-line tool for setting up, tracking, and fixing the Windows Time service. W32 tm.exe is consisted of with Windows XP and later on and Windows Server 2003 and later on.

Membership in the regional Administrators group is needed to run W32 tm.exe in your area, while subscription in the Domain Admins group is needed to run W32 tm.exe from another location.

Run W32 tm.exe

  1. In the Windows search bar, go into cmd
  2. Right-click Command Prompt, then choose Run as administrator
  3. At the command timely, go into w32 tm followed by the suitable criterion, as explained listed below:

time epoch>

Parameter Description
/? Displays the W32 tm command-line aid
/ register Registers the Windows Time service to run as a service and includes its default setup info to the computer system registry.
/ unregister Unregisters the Windows Time service and eliminates all of its setup info from the computer registry.
/ screen [/domain:<domain name> ] [/computer systems: [,<name> [, …]]] [/threads:] Monitors the Windows Time service./ domain : Specifies which domain to keep an eye on. If no domain is provided, or neither the/ domain nor/ computer systems choice is defined, the default domain is utilized. This choice may be utilized more than as soon as.

/ computer systems: Monitors the provided list of computer systems. Computer system names are separated by commas, without any areas. If a name is prefixed with a *, it is dealt with as a PDC. This choice may be utilized more than as soon as.

/ threads: Specifies the variety of computer systems to evaluate at the same time. The default worth is 3. The enabled variety is 1-50

/ ntte< NT time date > Converts a Windows NT system time (determined in10 -7– 2nd periods beginning with 0h 1-Jan1601) into a legible format.
/ ntpte< NTP time date > Converts an NTP time( determined in 2– 32– 2nd periods beginning with 0h 1-Jan1900) into a legible format.
/ resync [/computer system: ] [/nowait] [/rediscover] [/soft] Tells a computer system that it need to resynchronize its clock as quickly as possible, tossing out all collected mistake data./ computer system:: Specifies the computer system that ought to resynchronize. If not defined, the regional computer system will resynchronize.

/ nowait: do not wait on resynchronization to happen; return right away. Otherwise, await resynchronization to finish prior to returning.

/ rediscover : Redetects the network setup and uncovers network sources, then resynchronizes.

/ soft: Resynchronizes by utilizing existing mistake stats. This is utilized for compatibility functions.

/ stripchart/ computer system:< target > [/duration:] [/dataonly] [/samples: < count >] [/rdtsc] Displays a strip chart of the balanced out in between this computer system and another computer system./ computer system:: The computer system to determine the balanced out versus.

/ duration::<count>The time in between samples, in seconds. The default is 2 seconds.

/ dataonly : Displays the information just, without graphics.

/ samples: : Collects samples, then stops. If not defined, samples will be gathered up until Ctrl + C is pushed.

/ rdtsc: For each sample, this choice prints comma-separated worths in addition to the headers RdtscStart, RdtscEnd, FileTime , RoundtripDelay , and NtpOffset rather of the text graphic.

  • RdtscStart: RDTSC (Read Time Stamp Counter ) worth gathered prior to the NTP demand was created.
  • RdtscEnd : RDTSC worth gathered simply after the NTP action was gotten and processed.
  • FileTime: Local FILETIME worth utilized in the NTP demand.
  • RoundtripDelay: Time expired in seconds in between producing the NTP demand and processing the gotten NTP reaction, calculated according to NTP roundtrip calculations.
  • NTPOffset: Time balanced out in seconds in between the regional computer system and the NTP server, calculated according to NTP balanced out calculations.
/ config [/computer system:] [/upgrade] [/manualpeerlist:] [/syncfromflags:] [/LocalClockDispersion:] [/trusted: (YES|NO)] [/largephaseoffset:] / computer system:: Adjusts the setup of. If not defined, the default is the regional computer system./ upgrade: Notifies the Windows Time service <peers>that the setup has actually altered, triggering the modifications to work.

/ manualpeerlist:< peers >: Sets the manual peer list to, which is a space-delimited list of DNS or IP addresses. <source> When defining several peers, this alternative should be confined in quotes.

/ syncfromflags:: Sets what sources the NTP customer ought to integrate from. need to be a comma-separated list of these keywords( not case delicate):

  • MANUAL: Include peers from the manual peer list.
  • DOMHIER: Synchronize from a domain controller( DC) in the domain hierarchy.

/ LocalClockDispersion: : Configures the precision of the biological rhythm that W 32 Time will presume when it can’t get time from its configured sources./ dependable:( YES|NO): Set whether this computer system is a reputable time source. This setting is just significant on domain controllers.

  • YES: This computer system is a trustworthy time service.
  • NO: This computer system is not a reputable time service.

/ largephaseoffset:: sets the time distinction in between regional and network time that W32 Time will think about a spike.

/ tz Displays the present time zone settings.
/ dumpreg [/subkey:] [/computer system:] Displays the worths related to a provided computer system registry secret.<key> The default secret is HKLM System CurrentControlSet Services W32 Time( the root secret for the Windows Time service).

/ subkey:: Displays the worths connected with subkey of the default secret.

/ computer system:: Queries computer system registry settings for computer system

/ question [/computer system:] [/source |/ setup |/ peers |/ status] [/verbose] Displays the computer system’s Windows Time service details. This specification was initially provided for the Windows Time customer in Windows Vista and Windows Server2008/ computer system:< target >: Queries the info of. If not defined, the default worth is the regional computer system.

/ source: Displays the time source.

/ setup: Displays the setup of run time and where the setting originates from. In verbose mode, show the undefined or unused setting too.

/ peers: Displays a list of peers and their status.

/ status: Displays Windows Time service status.

/ verbose: Sets the verbose mode to show more details.

/ debug[/disable|[/make it possible for/ file:/ size:// entries: [/truncate]]] Enables or disables the regional computer system Windows Time service personal log. This criterion was initially provided for the Windows Time customer in Windows Vista and Windows Server 2008./ disable: Disables the personal log.

/ make it possible for: Enables the personal log.

  • file: : Specifies the outright file name.
  • size: : Specifies the optimum size for circular logging.
  • entries: : Contains a list of flags, defined by number and separated by commas, that define the kinds of info that ought to be logged. Legitimate worths are 0 to300 A series of numbers stands, in addition to single numbers, such as 0-100,103,106 Worth 0-300 is for logging all info.

/ truncate : Truncate the file if it exists.

Set customer to utilize 2 time servers

To set a customer computer system to indicate 2 various time servers, one called ntpserver.contoso.com and another called clock.adatum.com, type the following command at the command timely, and after that press ENTER:

 w32tm/ config/ manualpeerlist:" ntpserver.contoso.com clock.adatum.com"/ syncfromflags: manual/ upgrade 

Set customer to sync time instantly from a domain source

To set up a customer computer system that is presently integrating time utilizing a manually-specified computer system to integrate time instantly from the advertisement domain hierarchy, run the following following:

w32 tm/ config/ syncfromflags: domhier/ upgrade net stop w32 time net start w32 time

Check customer time setup

To examine a customer setup from a Windows-based customer computer system that has a host name of contosoW1, run the following command:

 W32 tm/ question/ computer system: contosoW1/ setup

The output of this command shows a list of W32 time setup criteria that are set for the customer.

Important

Windows Server2016 has actually enhanced the time synchronization algorithms to line up with RFC specs. If you desire to set the regional time customer to point to numerous peers, we suggested that you prepare 3 or more various time servers.

If you have just 2 time servers, you must define the Ntpserver UseAsFallbackOnly flag (0x2) to de-prioritize among them. If you desire to focus on ntpserver.contoso.com over clock.adatum.com, run the following command.

 w32 tm/ config/ manualpeerlist:" ntpserver.contoso.com,0 x8 clock.adatum.com,0 xa"/ syncfromflags: manual/ upgrade 

Additionally, you can run the following command and check out the worth of NtpServer in the output:

 reg question HKLM  SYSTEM  CurrentControlSet  Services  W32 Time  Parameters 

Configure computer system clock reset

In order for W32 tm.exe to reset a computer system clock, it initially inspects the balanced out ( CurrentTimeOffset, likewise called Phase Offset) in between the existing time and the computer system clock time to identify whether the balanced out is less than the MaxAllowedPhaseOffset worth.

  • CurrentTimeOffset MaxAllowedPhaseOffset: Adjust the computer system clock slowly by utilizing the clock rate.
  • CurrentTimeOffset > MaxAllowedPhaseOffset: Set the computer system clock right away.

Then, to change the computer system clock by utilizing the clock rate, W32 tm.exe computes a PhaseCorrection worth. This algorithm differs depending upon the variation of Windows:

  • Windows Server 2016 and later on variations:

    PhaseCorrection_raw =| CurrentTimeOffset|÷ (16 × PhaseCorrectRate × pollIntervalInSeconds)
    MaximumCorrection =| CurrentTimeOffset|÷ ( UpdateInterval ÷ 100)
    PhaseCorrection = minutes( PhaseCorrection_raw, MaximumCorrection)

  • Windows Server 2012 R2 and earlier variations:

To get the SystemClockRate worth, you can utilize the following command and transform it from seconds to clock ticks by utilizing the formula of (seconds × 1,000 × 10,000):

PhaseCorrection =| CurrentTimeOffset|÷ ( PhaseCorrectRate × UpdateInterval)

All variations of Windows utilize the very same last formula to inspect PhaseCorrection:

PhaseCorrection SystemClockRate ÷ 2

Note
  • Windows Server 2019 and Windows 10 1809 have the exact same formula as [Windows Server 2016 and later on variations] explained above by using cumulative updates from KB5006744 onwards.
  • These formulas utilize PhaseCorrectRate, UpdateInterval, MaxAllowedPhaseOffset, and SystemClockRate determined in systems of clock ticks. On Windows systems, 1 ms = 10,000 clock ticks.
  • MaxAllowedPhaseOffset is configurable in the windows registry. The computer system registry criterion is determined in seconds rather of clock ticks.
  • To see the SystemClockRate and pollIntervalInSeconds worths (determined in seconds), open a Command Prompt window and after that run W32 tm/ question/ status/ verbose This command produces output that looks like the following.
    Output of the w32tm /query /status /verbose command, that lists parameter values for the time service.
    The output provides the survey period in both clock ticks and in seconds. The formulas utilize the worth determined in seconds (the worth in parentheses).
    The output provides the clock rate in seconds. To see the SystemClockRate worth in clock ticks, utilize the following formula:

    ( worth in seconds) × 1,000 × 10,000

    For example, if SystemClockRate is 0.0156250 seconds, the worth that the formula utilizes is 156,250 clock ticks. For complete descriptions of the configurable specifications and their default worths, see Config entries later on in this post.

The copying demonstrate how to use these estimations for Windows Server 2012 R2 and earlier variations.

Example: System clock rate off by 4 minutes

Your computer system clock time is 11: 05 and the real existing time is 11: 09:

PhaseCorrectRate = 1

Like this post? Please share to your friends:
Leave a Reply

;-) :| :x :twisted: :smile: :shock: :sad: :roll: :razz: :oops: :o :mrgreen: :lol: :idea: :grin: :evil: :cry: :cool: :arrow: :???: :?: :!: