-
Notifications
You must be signed in to change notification settings - Fork 5
time_sync_fix.ps1
Corey Watson edited this page Dec 24, 2025
·
2 revisions
Fix Windows time synchronization issues.
Fixes Windows time synchronization by setting the timezone, resetting the Windows Time service, configuring NTP servers, and forcing a time sync. Resolves common time drift and synchronization issues.
Resolves Windows time synchronization problems that can cause authentication failures, certificate errors, and other time-sensitive issues on managed endpoints.
- Windows 10/11
- Admin privileges required
- Network connectivity to NTP servers
- TimeZone: Windows timezone ID (e.g., "Eastern Standard Time")
- NtpServers: Comma-separated list of NTP servers
- Uses pool.ntp.org servers by default
- Sets SpecialPollInterval to 86400 seconds (24 hours)
- Configures w32time triggers for network on/off
- Sets the system timezone
- Stops the Windows Time service
- Unregisters and re-registers w32time
- Configures NTP poll interval in registry
- Sets service triggers for network connectivity
- Starts the Windows Time service
- Configures NTP server list
- Forces immediate time resync
- No secrets in logs
- Modifies system time settings
- Uses public NTP servers
- 0: Success
- 1: Failure
[ INPUT VALIDATION ]
--------------------------------------------------------------
Time Zone : Eastern Standard Time
NTP Servers : 0.pool.ntp.org,1.pool.ntp.org,2.pool.ntp.org,3.pool.ntp.org
[ OPERATION ]
--------------------------------------------------------------
Setting timezone...
Stopping Windows Time service...
Re-registering Windows Time service...
Configuring NTP poll interval...
Setting service triggers...
Starting Windows Time service...
Configuring NTP servers...
Forcing time resync...
[ RESULT ]
--------------------------------------------------------------
Status : Success
Time Zone : Eastern Standard Time
Time : 2025-11-29 14:32:15
[ SCRIPT COMPLETED ]
--------------------------------------------------------------
- v1.0.0 (2025-11-29): Initial Style A implementation
- View Script Source
- Scripts - Back to script index