Force time sync during boot and every hour in Windows 11

1 minute reading time (134 words)
sonja-langford-eIkbSc3SDtI-unsplash

 To force time sync during boot and every hour in Windows 11, you can create a PowerShell script with the following commands:

#Set the time server to sync with
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers" -Name "1" -Value "time.windows.com"

#Enable automatic time synchronization every hour
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient" -Name "SpecialPollInterval" -Value "3600"

#Start the Windows Time service
Start-Service w32time 

 Save the script with a .ps1 extension, and then set it to run on startup by following these steps:

  1. Press the Windows key + R on your keyboard to open the Run dialog box.
  2. Type "shell:startup" (without the quotes) and press Enter. This will open the Startup folder.
  3. Create a shortcut to your PowerShell script in the Startup folder.
  4. Restart your computer to test the script.

The script will force a time sync during boot and every hour thereafter.


Font size: +
Report Print
×
Stay Informed

When you subscribe to the blog, we will send you an e-mail when there are new updates on the site so you wouldn't miss them.

By accepting you will be accessing a service provided by a third-party external to https://www.klokur.com/