User Tools

Site Tools


os:windows:cli

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
os:windows:cli [2015-08-08 17:00] – created rootos:windows:cli [2024-04-25 19:32] (current) – [Set NTP Servers] add link to Windows Time service tools and settings Manuel Frei
Line 8: Line 8:
 PsExec -s cmd PsExec -s cmd
 </code> </code>
 +
 +===== Check Remote NTP Server =====
 +
 +The following command will contact the NTP server 192.0.2.1 and show you 5 samples by printing time and offset.
 +<code>
 +w32tm /stripchart /computer:192.0.2.1 /dataonly /samples:5
 +</code>
 +
 +Example with output.
 +<code>
 +PS C:\> w32tm /stripchart /computer:192.0.2.1 /dataonly /samples:5
 +Tracking 192.0.2.1 [192.0.2.1:123].
 +Collecting 5 samples.
 +The current time is 18.04.2024 10:04:19.
 +10:04:19, -191.1682338s
 +10:04:21, -191.1659023s
 +10:04:23, -191.1665833s
 +10:04:25, -191.1664487s
 +10:04:27, -191.1664522s
 +</code>
 +
 +===== Show Time Source =====
 +
 +Show the current time source.
 +
 +<code>
 +w32tm /query /status
 +</code>
 +
 +Example: NTP time source with server 192.0.2.1.
 +
 +<code>
 +PS C:\> w32tm /query /status
 +Leap Indicator: 0(no warning)
 +Stratum: 3 (secondary reference - syncd by (S)NTP)
 +Precision: -23 (119.209ns per tick)
 +Root Delay: 0.0133334s
 +Root Dispersion: 0.0289849s
 +ReferenceId: 0xC0A80101 (source IP:  192.0.2.1)
 +Last Successful Sync Time: 25.04.2024 19:12:36
 +Source: 192.0.2.1
 +Poll Interval: 10 (1024s)
 +</code>
 +
 +===== Set NTP Servers =====
 +
 +Set your NTP servers manually, separated by space if more than one.
 +<code>
 +w32tm /config /manualpeerlist:"192.0.2.1 192.0.2.2" /syncfromflags:manual /update
 +</code>
 +
 +More information: [[https://learn.microsoft.com/en-us/windows-server/networking/windows-time-service/windows-time-service-tools-and-settings?tabs=config|learn.microsoft.com: Windows Time service tools and settings]]
 +
os/windows/cli.1439046048.txt.gz · Last modified: 2015-08-08 17:00 by root