Created
July 1, 2020 01:27
-
-
Save rm77/e0f2446b9ec8807f913c064a8af763d9 to your computer and use it in GitHub Desktop.
set time zone and ntp server
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
# Configure Time Zone and NTP server | |
# Variables | |
$TimeZone = "SE Asia Standard Time" | |
$NTPServer = "ntp.its.ac.id" | |
# Configure NTP and restart service | |
Set-TimeZone -Id $TimeZone -PassThru | |
Push-Location | |
Set-Location HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers | |
Set-ItemProperty . 0 $NTPServer | |
Set-ItemProperty . "(Default)" "0" | |
Set-Location HKLM:\SYSTEM\CurrentControlSet\services\W32Time\Parameters | |
Set-ItemProperty . NtpServer $NTPServer | |
Pop-Location | |
Stop-Service w32time | |
Start-Service w32time | |
#jalankan dengan powershell -File set_time.ps1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment