Windows Time Service Tools and Settings
Windows Time Service Tools and Settings
Settings
10/15/2018
Applies to: Windows Server 2016, Windows Server 2012 R2, Windows Server 2012,
Windows 10 or later
In this topic, you learn about tools and settings for Windows Time service (W32Time).
If you only want to synchronize time for a domain-joined client computer, see
Configure a client computer for automatic domain time synchronization. For additional
topics about how to configure Windows Time service, see Where to Find Windows
Time Service Configuration Information.
Caution
You should not use the Net time command to configure or set time when the Windows
Time service is running.
Also, on older computers that run Windows XP or earlier, the command Net time
/querysntp displays the name of a Network Time Protocol (NTP) server with which a
computer is configured to synchronize, but that NTP server is used only when the
computer's time client is configured as NTP or AllSync. That command has since been
deprecated.
Most domain member computers have a time client type of NT5DS, which means that
they synchronize time from the domain hierarchy. The only typical exception to this is
the domain controller that functions as the primary domain controller (PDC) emulator
operations master of the forest root domain, which is usually configured to synchronize
time with an external time source. To view the time client configuration of a computer,
run the W32tm /query /configuration command from an elevated Command Prompt in
starting in Windows Server 2008, and Windows Vista, and read the Type line in the
command output. For more information, see How Windows Time Service Works. You
can run the command reg query
HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Parameters and read the
value of NtpServer in the command output.
Important
Prior to Windows Server 2016, the W32Time service was not designed to meet time-
sensitive application needs. However, updates to Windows Server 2016 now allow you
to implement a solution for 1ms accuracy in your domain. See Windows 2016 Accurate
Time and Support boundary to configure the Windows Time service for high-accuracy
environments for more information.
Windows Time Service Tools
The following tools are associated with the Windows Time service.
Category
This tool is installed as part of Windows XP, Windows Vista, Windows 7 , Windows
Server 2003, Windows Server 2003 R2, Windows Server 2008 , and Windows Server
2008 R2 default installations.
Version compatibility
This tool works on Windows XP, Windows Vista, Windows 7 , Windows Server 2003,
Windows Server 2003 R2, Windows Server 2008 , and Windows Server 2008 R2
default installations.
W32tm.exe is used to configure Windows Time service settings. It can also be used to
diagnose problems with the time service. W32tm.exe is the preferred command line tool
for configuring, monitoring, or troubleshooting the Windows Time service.
The following tables describe the parameters that are used with W32tm.exe.
Parameter Description
W32tm /? W32tm command line help
Registers the time service to run as a service and adds
W32tm /register
default configuration to the registry.
Unregisters the time service and removes all configuration
W32tm /unregister
information from the registry.
domain - specifies which domain to monitor. If no domain
name is given, or neither the domain nor computers option is
specified, the default domain is used. This option might be
used more than once.
w32tm /monitor
computers - monitors the given list of computers. Computer
[/domain:] names are separated by commas, with no spaces. If a name
[/computers:[,[,...]]] is prefixed with a '*', it is treated as a PDC. This option
[/threads:] might be used more than once.
[/period:] rdtsc: for each sample, this option prints comma separated
values along with the headers RdtscStart, RdtscEnd,
[/dataonly] FileTime, RoundtripDelay, NtpOffset instead of the text
graphic.
[/samples:]
RdtscStart – RDTSC (Read TimeStamp Counter)
[/rdtsc] value collected just before the NTP request was
generated.
RdtscEnd – RDTSC (Read TimeStamp Counter)
value collected just after the NTP response was
received and processed.
FileTime – Local FILETIME value used in the NTP
request.
RoundtripDelay – Time elapsed in seconds between
generating the NTP request and processing the
received NTP response, computed as per NTP
roundtrip computations.
Parameter Description
NTPOffset – Time offset in seconds between the
local machine and the NTP server, computed as per
NTP offset computations.
For more information about W32tm.exe, see Help and Support Center in Windows XP,
Windows Vista, Windows 7 , Windows Server 2003, Windows Server 2003 R2,
Windows Server 2008 , and Windows Server 2008 R2.
Windows Time Service Registry Entries
The following registry entries are associated with the Windows Time service.
When possible, use Group Policy or other Windows tools, such as Microsoft
Management Console (MMC), to accomplish tasks rather than editing the registry
directly. If you must edit the registry, use extreme caution.
Warning
Some of the preset values that are configured in the System Administrative template file
(System.adm) for the Group Policy object (GPO) settings are different from the
corresponding default registry entries. If you plan to use a GPO to configure any
Windows Time setting, be sure that you review Preset values for the Windows Time
service Group Policy settings are different from the corresponding Windows Time
service registry entries in Windows Server 2003. This issue applies to Windows Server
2008 R2 , Windows Server 2008 , Windows Server 2003 R2, and Windows Server
2003.
Many registry entries for the Windows Time service are the same as the Group Policy
setting of the same name. The Group Policy settings correspond to the registry entries of
the same name located in:
HKLM\SYSTEM\CurrentControlSet\Services\W32Time\
There are several registry keys at this registry location. The Windows Time settings are
stored in values across all of these keys:
Parameters
Config
NtpClient
NtpServer
Many of the values in the W32Time section of the registry are used internally by
W32Time to store information. These values should not be manually changed at any
time. Do not modify any of the settings in this section unless you are familiar with the
setting and are certain that the new value will work as expected. The following registry
entries are located under:
HKLM\SYSTEM\CurrentControlSet\Services\W32Time
When you create a policy, the settings are configured in the following location, which
does not take precedence over the next location:
HKLM\SOFTWARE\Policies\Microsoft\Windows\W32time
The W32time key is created with the policy. When you remove the policy, then this key
is also removed.
HKLM\SYSTEM\CurrentControlSet\Services\W32time
Some of the parameters are stored in clock ticks in the registry and some are in seconds.
To convert the time from clock ticks to seconds:
1 minute = 60 sec
1 sec = 1000 ms
1 ms = 10,000 clock ticks on a Windows system, as described at
DateTime.Ticks Property.
All versions include Windows 7, Windows 8, Windows 10, Windows Server 2008 , and
Windows Server 2008 R2, Windows Server 2012, Windows Server 2012R2, Windows
Server 2016. Some entries are only availalbe on newer Windows versions.
HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Parameters
0x01 SpecialInterval
0x02 UseAsFallbackOnly
0x04 SymmetricActive - For
more information about this
mode, see Windows Time
Server: 3.3 Modes of Operation.
Registry Entry Version Description
0x08 Client
HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Config
The following registry entries must be added in order to enable W32Time logging:
Registry
Version Description
Entry
Entry controls the amount of entries created in the Windows
Time log file. The default value is none, which does not log
FileLogEntries All any Windows Time activity. Valid values are 0 to 300. This
value does not affect the event log entries normally created by
Windows Time
Entry controls the location and file name of the Windows Time
log. The default value is blank, and should not be changed
unless FileLogEntries is changed. A valid value is a full path
FileLogName All
and file name that Windows Time will use to create the log file.
This value does not affect the event log entries normally
created by Windows Time.
Entry controls the circular logging behavior of Windows Time
log files. When FileLogEntries and FileLogName are defined,
Entry defines the size, in bytes, to allow the log file to reach
FileLogSize All before overwriting the oldest log entries with new entries.
Please use 1000000 or larger value for this setting. This value
does not affect the event log entries normally created by
Windows Time.
HKLM\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClien
t
- None: 0
- PdcOnly: 1
CrossSiteSyncFlags All
- All: 2
Yes 1
Enabled All
No 0
Yes = 1
No = 0
HKLM\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpServe
r
Yes = 1
No = 0
MaxAllowedPhaseOffset information
In order for W32Time to set the computer clock gradually, the offset must be less than
the MaxAllowedPhaseOffset value and satisfy the following equation at the same time:
|CurrentTimeOffset| / (16*PhaseCorrectRate*pollIntervalInSeconds)
<= SystemClockRate / 2
Windows Server 2012 R2 and earlier versions:
|CurrentTimeOffset| / (PhaseCorrectRate*UpdateInterval) <=
SystemClockRate / 2
The CurrentTimeOffset value is measured in clock ticks, where 1ms = 10,000 clock
ticks on a Windows system.
SystemClockRate and PhaseCorrectRate are also measured in clock ticks. To get the
SystemClockRate value, you can use the following command and convert it from
seconds to clock ticks by using the formula of seconds*1000*10000:
SystemclockRate is the rate of the clock on the system. Using 156000 seconds as an
example, the SystemclockRate value would be = 0.0156000 * 1000 * 10000 = 156000
clock ticks.
Example 1: Time differs by 4 minutes (for example, your time is 11:05 and the time
sample that you received from a peer and believe to be correct is 11:09).
phasecorrectRate = 1
NO/FALSE
Note
In this case, if you want to set the clock back slowly, you would also have to adjust the
values of PhaseCorrectRate or updateInterval in the registry to make sure that the
equation result is TRUE.
phasecorrectRate = 1
YES/TRUE
Note
Group Policy settings for the Windows Time service can be configured on Windows
Server 2003, Windows Server 2003 R2, Windows Server 2008 , and Windows Server
2008 R2 domain controllers and can be applied only to computers running Windows
Server 2003, Windows Server 2003 R2, Windows Server 2008 , and Windows Server
2008 R2 .
You can find the Group Policy settings used to configure W32Time in the Group Policy
Object Editor snap-in in the following locations:
Warning
Some of the preset values that are configured in the System Administrative template file
(System.adm) for the Group Policy object (GPO) settings are different from the
corresponding default registry entries. If you plan to use a GPO to configure any
Windows Time setting, be sure that you review Preset values for the Windows Time
service Group Policy settings are different from the corresponding Windows Time
service registry entries in Windows Server 2003. This issue applies to Windows Server
2008 R2 , Windows Server 2008 , Windows Server 2003 R2, and Windows Server
2003.
The following table lists the global Group Policy settings that are associated with the
Windows Time service and the pre-set value associated with each setting. For more
information about each setting, see the corresponding registry entries in Windows Time
Service Registry Entries earlier in this subject. The following settings are contained in a
single GPO called Global Configuration Settings.
The following table lists the available settings for the Configure Windows NTP Client
GPO and the pre-set values that are associated with the Windows Time service. For
more information about each setting, see the corresponding registry entries in Windows
Time Service Registry Entries earlier in this subject.
Note
If you have a computer with multiple network adapters (also called a multihomed
computer), you cannot selectively enable the Windows Time service based on the
network adapter.