Last active
December 23, 2019 01:12
-
-
Save rob89m/81acc83d66a56de3ed6fd6c8e43410fc to your computer and use it in GitHub Desktop.
Set Time Sync #NTP #TIME
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.DESCRIPTION | |
This script set external NTP to NTP.ORG then resync the time. | |
#> | |
# Set W32Time to Automatic start if not already enabled | |
Get-Service w32time | ` | |
%{If($_.StartType -ne "Automatic"){Set-Service w32time -StartType Automatic}} | ` | |
# Set the external NTP Server | |
w32tm.exe /config /manualpeerlist:"au.pool.ntp.org" /syncfromflags:manual /reliable:yes /update | |
# Restart the w32tm service | |
net stop w32time | |
net start w32time | |
# Resync the time the the external NTP Server | |
w32tm /resync |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment