<\/a>Step 5: Several useful commands<\/h3>\nUseful information about time synchronization:<\/p>\n
w32tm /query /status<\/p>\n
Command to debug to file:<\/p>\n
w32tm / debug / enable / file: C: \\ \\ / size: 10485760 / entries: 0-300<\/p>\n
After debug let’s turn it off:<\/p>\n
w32tm /debug /disable<\/p>\n
Command to forcing client sync:<\/p>\n
w32tm /resync<\/p>\n
To reset the settings, use the command:<\/p>\n
w32tm /unregister<\/p>\n
Next, restore the default settings:<\/p>\n
w32tm /register<\/p>\n<\/div>","step":[{"@type":"HowToStep","name":"Start and stop time service","text":"\nUse this commands:\n\nnet start w32time\n\nnet stop w32time\n\nor\n\nstop-service w32time\n\nstart-service w32time"},{"@type":"HowToStep","name":"Let's specify the server with which we will synchronize time","text":"\nCheck if our time is synchronized with Microsoft's public ntp server:\n\n\nw32tm /stripchart /computer:time.windows.com /samples:4 /dataonly\n\n"},{"@type":"HowToStep","name":"Choose trusted time source","text":"\nNow we’ll point out that we have to synchronize with this server and say that we are a trusted time source:\n\nw32tm /config /manualpeerlist: time.windows.com /syncfromflags:manual /reliable:yes /update\n\n\n\n"},{"@type":"HowToStep","name":"Synchronize with several public time sources","text":"\nIf you need to synchronize with several public time sources, the command will look like this:\n\nw32tm /config /manualpeerlist:\"ntp1.sp.se ntp2.sp.se\" /syncfromflags:MANUAL /reliable:yes /update\n\n\n"},{"@type":"HowToStep","name":"Several useful commands","text":"\nUseful information about time synchronization:\n\nw32tm /query /status\n\nCommand to debug to file:\n\nw32tm / debug / enable / file: C: \\ \\ / size: 10485760 / entries: 0-300\n\nAfter debug let's turn it off:\n\nw32tm /debug /disable\n\nCommand to forcing client sync:\n\nw32tm /resync\n\nTo reset the settings, use the command:\n\nw32tm /unregister\n\nNext, restore the default settings:\n\nw32tm /register\n\n\n\n\n"}]}
In this article we will discuss the main points of working with ntp through Powershell on Windows server 2012. We will do this on the domain controller. So let’s get started.
Step 1: Start and stop time service
Use this commands:
net start w32time
net stop w32time
or
stop-service w32time
start-service w32time
Step 2: Let’s specify the server with which we will synchronize time
Check if our time is synchronized with Microsoft’s public ntp server:
w32tm /stripchart /computer:time.windows.com /samples:4 /dataonly
Step 3: Choose trusted time source
Now we’ll point out that we have to synchronize with this server and say that we are a trusted time source:
w32tm /config /manualpeerlist: time.windows.com /syncfromflags:manual /reliable:yes /update
Step 4: Synchronize with several public time sources
If you need to synchronize with several public time sources, the command will look like this:
w32tm /config /manualpeerlist:“ntp1.sp.se ntp2.sp.se” /syncfromflags:MANUAL /reliable:yes /update
Step 5: Several useful commands
Useful information about time synchronization:
w32tm /query /status
Command to debug to file:
w32tm / debug / enable / file: C: \ \ / size: 10485760 / entries: 0-300
After debug let’s turn it off:
w32tm /debug /disable
Command to forcing client sync:
w32tm /resync
To reset the settings, use the command:
w32tm /unregister
Next, restore the default settings:
w32tm /register
13 Spice ups
robbjeff
(robbjeff)
September 23, 2019, 11:21am
2
Are steps 2 and 3 redundant or necessary repetition? Thanks in advance.
Yes, they are redundant, thanks for reporting this.
I corrected it.
Uhm, wow nice, congrats.
And where is the PS stuff?