搭建window時間服務器:

搭建window時間服務器:
服務端配置 適用於Windows Server 2003以及Windows Sever 2008
1) 開放防火牆123 UDP端口;
2) 運行中輸入“gpedit.msc”;
3) 展開“策略”下的“計算機配置”(如果顯示)中的“管理模板\系統\Windows 時間服務\全局配置設置”;
4) 將其狀態改變爲“已啓用”;
5) 改變AnnounceFlags參數值爲5,
參數含義: a) 0 不作爲時間服務器; b) 1 始終爲時間服務器; c) 2 自動爲時間服務器,意味着由 Windows 時間服務來決定角色; d) 4 始終爲可靠時間服務器; e) 8 自動爲可靠時間服務器,意味着由 Windows 時間服務來決定角色。
6) 展開“策略”下的“計算機配置”(如果顯示)中的“管理模板\系統\Windows 時間服 務\時間提供程序\啓用Windows NTP服務器”
7) 將其狀態改變爲“已啓用”;
8) 在Windows 服務中啓動Windows Time服務,並設置啓動類型爲“自動”;
9) 完成。
客戶端配置 適用於Windows XP、Windows Server 2003、Windows Vista、Windows 7以及Windows Sever 2008。
1) 運行中輸入“gpedit.msc”;
2) 展開“策略”下的“計算機配置”(如果顯示)中的“管理模板\系統\Windows 時間服務\時間提供程序\啓用Windows NTP客戶端”
3) 將其狀態改變爲“已啓用”;
4) 展開“策略”下的“計算機配置”(如果顯示)中的“管理模板\系統\Windows 時間服務\時間提供程序\配置Windows NTP客戶端”
5) 將其狀態改變爲“已啓用”;
6) 改變NtpServer參數中的IP爲時間服務器地址,例如:192.168.0.1,0x1;
7) 改變Type參數NTP;
8) 在Windows 服務中啓動Windows Time服務,並設置啓動類型爲“自動”;
9) 完成。

bat腳本如下:

@echo off
echo autor OAK
@echo off
echo --------------------------------
@echo off
echo setup time resync every one hour
@echo off
REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient /v SpecialPollInterval /t REG_DWORD /d 3600 /f
@echo off
echo --------------------------------
echo setup w32time auto startup
@echo off
REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time /v Start /t REG_DWORD /d 2 /f
@echo off
echo --------------------------------
@echo off
set /p TimeServer=Please Input The Time Server IP:
net time /setsntp:%TimeServer%
net stop w32time
net start w32time
w32tm /resync
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章