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 .

The Windows Time service (W32Time) is a service that synchronizes the date and time for all computers running on a network. You can manage this service from the command line using the w32tm utility.

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

W32tm: manage Windows time service from command line

  1. Display Current Configuration
    • Command: w32tm /query /configuration
    • This command displays the current configuration of the Windows Time service.
  2. Resynchronize the Clock
    • Command: w32tm /resync
    • This forces the computer to resynchronize its clock immediately with its time source.
  3. Configure Time Source
    • Command: w32tm /config /manualpeerlist:"[servername]" /syncfromflags:manual /reliable:YES /update
    • Replace [servername] with the NTP server you wish to use. This command sets a specific NTP server as the time source and marks it as reliable.
  4. Display Status
    • Command: w32tm /query /status
    • Shows the status of the Windows Time service, including the source of time synchronization.
  5. Register the Time Service
    • Command: w32tm /register
    • This command is used to register the Windows Time service if it has been unregistered or needs to be re-registered.
  6. Unregister the Time Service
    • Command: w32tm /unregister
    • This will unregister the Windows Time service, often used for troubleshooting.
  7. Configure to Use an External Time Source
    • Command: w32tm /config /syncfromflags:manual /manualpeerlist:"[external NTP servers]" /reliable:no /update
    • This command is used when configuring the system to synchronize with an external time source (NTP server). Replace [external NTP servers] with the desired NTP server addresses.
  8. Restart the Service
    • After making changes, it’s often necessary to restart the Windows Time service for the changes to take effect. You can do this with the following commands:
      • Stop the service: net stop w32time
      • Start the service: net start w32time

These commands provide basic management capabilities for the Windows Time service directly from the command line. Always ensure you have the necessary permissions to execute these commands, especially in a networked or corporate environment.

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

As we have seen, managing the Windows Time Service from the command line using W32tm provides a convenient and efficient way to control time settings, check synchronization status, and troubleshoot time-related issues. By mastering the various commands and their functionalities, Windows users can ensure accurate and reliable timekeeping across their systems. So, leverage the power of W32tm and take control of your Windows time service today.

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