close

前言: 國家時間與頻率標準實驗室  && NTP伺服器

 

也可以忽略1~6 直接跳7

如果已改過機碼請使用


Cmd:
  net stop w32time
  w32tm /unregister 
  w32tm /register
  net start w32time

0. 直接下指令修改


Cmd: 
  w32tm /config /manualpeerlist:"time.stdtime.gov.tw clock.stdtime.gov.tw tick.stdtime.gov.tw watch.stdtime.gov.tw" /syncfromflags:manual /reliable:yes /update

-執行regedit---------------------------------------------------

1.設定成為NTP 伺服器類型


修改登錄檔中"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters"
[Type]設定值修改為NTP

2.設定授權時間伺服器


修改登錄檔中: "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config"
[AnnounceFlags]修改設定值為5

 

3.啟用NTP伺服器


修改登錄檔中: "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpServer"
[Enabled]數值修改為
1

 

4.指定查詢外部NTP 伺服器


修改登錄檔中"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters"
[NtpServer]數值修改為
time.stdtime.gov.tw clock.stdtime.gov.tw tick.stdtime.gov.tw tock.stdtime.gov.tw watch.stdtime.gov.tw,0x1

 

5.設定查詢時間間隔


修改登錄檔中"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient"
[SpecialPollInterval]修改數值為"十進位"900
*這邊使用的時間間隔單位為秒,設定900即為每900查詢一次步驟四所指定的時間伺服器。

 

6.設定時間修正設定


修改登錄檔中"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config"
[MaxPosPhaseCorrection]修改為十進位1800  (負差校正) - 
網路時間比本地時間超過這個秒數就不自動校正
[MaxNegPhaseCorrection]修改為十進位1800 (正差校正) - 
網路時間比本地時間超過這個秒數就不自動校正
*這邊單位也是秒

若要設定成無上限,可以設定成該 DWORD 的最大值 FFFFFFFF (十六進位值) ( 有 8 個 F )

-------------------------------------------------------------------------------------------------------------------

7.重起Windows Time服務。


Cmd: 
  net stop w32time 
  w32tm /config /update 
  net start 

 

8.打開 UDP:123


Cmd: 
  netsh firewall add portopening protocol = UDP port =123 name = NTPSERVER

 

二、客戶端設定 (Client)

 

 


Cmd: 
   w32tm /config /update /manualpeerlist:"time.stdtime.gov.tw clock.stdtime.gov.tw tick.stdtime.gov.tw tock.stdtime.gov.tw watch.stdtime.gov.tw,0x1"

 

 

PS:加上0x1就可以讓網域成員電腦每小時(預設值)自動校時一次

 


Cmd: 
  w32tm /config /update
  w32tm /resync

 

reference: 

https://dotblogs.com.tw/halladay/2012/05/11/72124

arrow
arrow
    文章標籤
    windows server time server
    全站熱搜
    創作者介紹
    創作者 M先生 的頭像
    M先生

    雨果

    M先生 發表在 痞客邦 留言(0) 人氣()