2026-11-20

PowerShell 設定台灣的 NTP Server

PowerShell 設定台灣的 NTP Server

$NTPServers = 'tick.stdtime.gov.tw,0x9 tock.stdtime.gov.tw,0x9 time.stdtime.gov.tw,0x9 clock.stdtime.gov.tw,0x9 watch.stdtime.gov.tw,0x9'
Write-Host "Setting NTP Servers..." -ForegroundColor Green
w32tm /config /syncfromflags:manual /manualpeerlist:"$NTPServers" /reliable:no /update | Out-Null
Restart-Service w32time -Force
Start-Sleep 5
w32tm /resync /force
Write-Host "`nCurrent Source:" -ForegroundColor Yellow
w32tm /query /source
Write-Host "`nCurrent Status:" -ForegroundColor Yellow
w32tm /query /status

沒有留言:

張貼留言