How do you manually trigger the first sync for 'Internet Time' in Windows?
Just stop and restart the time service net stop w32time
then net start w32time
.
Regarding Reaces suggestion, I can't recall if that works or not on first go/change when setting up NTP. If it does, good deal. You'd use w32tm /resync /nowait
if that's the case but for some reason I thought I had to restart the time service.
Related videos on Youtube
wlscaudill
Updated on September 18, 2022Comments
-
wlscaudill over 1 year
When launching a Windows Instance on AWS I'd like to trigger the "Internet Time" to be updated via the command line (powershell or cmd).
If I go to "Adjust date/time" and select the "Internet Time" tab I see "This computer is set to automatically synchronize on a scheduled basis."
The problem is that when I inspect the event log I see that the server never actually attempts to synchronize the time.
If I click on "Change Settings" and click the "Update now" button the text changes to: "Next synchronization: 1/1/2015 at 9:00 AM" "The clock was successfully synchronized with time-a.nist.gov on 1/1/2015 at 7:00 AM."
After this process I can see in the event log that the time is synchronized each night and the text in the UI gets updated accordingly.
I'd like to find the shell command that initiates this process so I can fire it the first time when the server is setup.
Thanks in advance to any suggestions!
-
kralyk about 9 yearsJust stop and restart the time service "net stop w32time" then "net start w32time"
-
Reaces about 9 years@TheCleaner Isn't this somewhat overkill? Shouldn't
w32tm /resync
do the same thing but cleaner? -
wlscaudill about 9 years@TheCleaner Thanks! This appears to have solved my issue, please submit as the answer and I'll mark it as such after I confirm on a new instance.
-
raja about 9 yearsNote that if you have to do this it usually means something went wrong during the boot up. Check the eventlog
-