設定Windows Server 2008 為NTP時間伺服器 & 客戶端設定

一、Windows Server 2008 – Time Server

 

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

 

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

如果已改過機碼請使用

1 Cmd:
2   net stop w32time
3   w32tm /unregister 
4   w32tm /register
5   net start w32time

0. 直接下指令修改

1 Cmd: 
2   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服務。

1 Cmd: 
2   net stop w32time 
3   w32tm /config /update 
4   net start

 

8.打開 UDP:123

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

 

二、客戶端設定 (Client)

 

 

1 Cmd: 
2    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就可以讓網域成員電腦每小時(預設值)自動校時一次

 

1 Cmd: 
2   w32tm /config /update
3   w32tm /resync

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章