How do I force sync the time on Windows Workstation or Server?

Solution 1:

As Kyle said w32tm /resync is the modern way to do this. See this Link to Microsoft Knowledgebase (KB 307897) for more information on the w32tm command.

There is also net time which is an older version but perhaps easier.

Solution 2:

For those that still asking this question.

  1. To update, use the command below (2008 and 2012 server compatible)

    w32tm /config /manualpeerlist:"ntp_server" /syncfromflags:manual /reliable:yes /update
    

change the ntp_server with your source

  1. Restart the time service

    net stop w32time
    net start w32time
    
  2. Resync the time

    w32tm /resync
    
  3. Verify your sync status

    w32tm /query /status
    

Commands above should be fine if your sources are working correctly and/or your connection is OK (firewall or Microsoft Forefront can be an issue also). The commands below can help with troubleshooting

To list out peers

w32tm /query /peers

To list out NTP Sources:

w32tm /query /source

Solution 3:

You can use the following command:

w32tm /resync


Solution 4:

You can use:

w32tm /resync

Additionally, using w32tm /resync /rediscover will also "force redetection of network resourced before resynchronization."

Or using:

net time /set

Will prompt you to set the time to the DC. (Works for older versions of Windows)


Solution 5:

OS: MS Windows 7

All above ideas have been tried but did not help. The original problem still exists: "The computer did not resync because the required time change was too big."

Solution is found in the registry: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\w32time\Config

  • change this if the local time is in a hurry (e.g. 31-Dec-2050): MaxNegPhaseCorrection
  • change this if the local time is delayed (e.g. 1-Jan-1980): MaxPosPhaseCorrection
  • The default values are 0xD2F0 (i.e. 54000 sec. = 15 hours)

(use Google for more details)

I use this simple win_clock_sync.bat file from Start Menu StartUp:

echo off
echo Sync computer time from internet
echo.
echo Back-up registry w32time\Config
reg export HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\w32time\Config exported_w32time.reg /y
rem changing the registry keys temporarly:
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\w32time\Config /v MaxNegPhaseCorrection /d 0xFFFFFFFF /t REG_DWORD /f
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\w32time\Config /v MaxPosPhaseCorrection /d 0xFFFFFFFF /t REG_DWORD /f
echo.
echo w32tm /config /update
w32tm /config /update
echo.
echo w32tm /resync /rediscover 
w32tm /resync /rediscover 
echo.
echo Restore registry w32time\Config
reg import exported_w32time.reg

Enjoy! :-)

Tags:

Windows

Time