W32tm: manage Windows time service from command line

W32tm.exe is the command line tool for configuring, monitoring, or troubleshooting the Windows Time service .

It allows you to configure Windows Time Service (W32time) settings such as changing the NTP server or forcing a synchronization .
You can also use W32tm.exe to diagnose problems with the time service.
It replaces the net time command .

Here are some examples of using this command line utility to manage the Windows system time from the command line .

Contents

  • 1Principle for using W32tm in command prompt
  • 2W32tm: manage Windows time service from command line
    • 1View the time service configuration
    • 2Force synchronization with the time server
    • 3Changing the Windows 10 time server
    • 4Summary of W32tm parameters
  • 3Links
  • 4Find the solution on the help forum

PRINCIPLE FOR USING W32TM IN COMMAND PROMPT

The Windows Time Service (W32Time) synchronizes the date and time of all computers running in Active Directory Domain Services (AD DS).
The Windows Time Service uses the Network Time Protocol (NTP) to synchronize the clocks of computers on the network .

NTP protocol and time servers

The time service does not have to be started or to use w32tm, it must be started otherwise you get the following error message:

The following error has occurred: The service has not been started. (0x80070426)

So before using w32tm, start the service with the services.msc console or:

  • Open a command prompt as an administrator
  • Then use the following command:

net start w32time

W32TM: MANAGE WINDOWS TIME SERVICE FROM COMMAND LINE

VIEW TIME SERVICE CONFIGURATION

Here is how to view the Windows time server configuration using w32tm.
This can be very useful in case of synchronization problem in order to debug.
For this, we use the / query parameter .

To display the general configuration of the time service, use the / configuration parameter :

w32tm /query /configuration

You can also display other information in particular on the NTP server with the parameters / query / status

To view the time zone configuration from the command line:

w32tm /tz

Finally to check the configuration of a remote PC , we use the parameter / computer

W32tm /query /computer:<nomduPC> /configuration

FORCE SYNCHRONIZATION WITH THE TIME SERVER

Here are the successive commands to enter in order to force synchronization with the default Windows time server time.windows.com.
The first line with / config reconfigure the time.windows.com time server.
Then the second line with / resync asks to synchronize on it.

w32tm /config /manualpeerlist:”time.windows.com” /syncfromflags:manual /reliable:yes /updatew32tm /resync

CHANGE WINDOWS 10 TIME SERVER

It is the / config parameter with / manualpeerlist which allows you to indicate the time server with which the PC must synchronize.

For example to change the time server with w32tm with 192.168.1.254:

w32tm /config /manualpeerlist:192.168.1.254 /syncfromflags:manual /reliable:yes /update

SUMMARY OF W32TM SETTINGS

Settings Description
/ register Registers the time service to run as a service and adds the default configuration to the registry.
/ unregister Cancels the time service registration and removes all configuration information from the registry.
/ monitor
[/ domain:] [/ computers: [, [,…]]] [/ threads:]
domain : specifies the domain to monitor. If no domain name is specified, or if the domain or computers option is not specified, the default domain is used. This option can be used multiple times.

computers : Monitors the given list of computers. Computer names are separated by commas, without spaces. If a name has the prefix “*”, it is treated as a primary domain controller (PDC). You can use this option more than once.

threads : Specifies the number of computers to scan simultaneously. The default is 3. The allowable range is 1 to 50.

w32tm / ntte Converts a Windows NT system time, in intervals of (10 ^ -7) s of 12:00 a.m. January 1, 1601, to a readable format.
w32tm / ntpte Converts a Network Time Protocol (NTP) time, in intervals of (2 ^ -32) s of 12:00 a.m. January 1, 1900, to a readable format.
w32tm / resync
[/ computer: <computer>]
[/ nowait]
[/ rediscover]
[/ soft]
Specifies the computer that should resynchronize. If no computer is specified, the local computer resynchronizes.
w32tm / stripchart
/ computer:
[/ period:]
[/ dataonly]
[/ samples:]
[/ packetinfo]
[ipprotocol: <4 | 6>
Displays a bar graph of the lag between this computer and another computer.
w32tm / config
[/ computer:]
[/ update]
[/ manualpeerlist:]
[/ syncfromflags:]
[/ LocalClockDispersion:]
[/ reliable: (YES | NO)]
[/ largephaseoffset:]
Adjust the configuration of the remote PC. If no value is specified, the default is local computer.
w32tm / tz Displays current time zone settings
w32tm / dumpreg
[/ subkey: <key>]
[/ computer: <target>]
Displays the values ​​associated with a given registry key.
w32tm / query [/ computer:] {/ source | / configuration | / peers | / status} [/ verbose] Displays information about a computer’s Windows time service
w32tm / debug {/ disable | {/ enable / file: / size: / entries: [/ truncate]}} Enables or disables the local computer Windows Time service private log

 

by Abdullah Sam
I’m a teacher, researcher and writer. I write about study subjects to improve the learning of college and university students. I write top Quality study notes Mostly, Tech, Games, Education, And Solutions/Tips and Tricks. I am a person who helps students to acquire knowledge, competence or virtue.

Leave a Comment