XP/Vista/Server 2003 內建了NTP Client,其實 Windows 2000 也是有內建 NTP Client Service 的
當然有加入網域的機器,就會自動跟網域主控站做時間同步
那麼沒有加入網域或是主控站本身呢?...就要自行手動設定欲同步的 NTP Server
步驟:
1. 先停止 W32Time Service。
net stop w32time
2. 設定校時用的伺服器
net time /setsntp:"time.windows.com time.stdtime.gov.tw"
3. 進行第一次的時間校時以便驗證
w32tm -once
4. 設定往後多久校時一次,以下是設定45分鐘內取得3次的時間,選擇一個最好的時間,並且每天執行 (Default 間隔為每天一次)
w32tm -period 65531
5. 重新啟動 W32Time Service
net start w32time
基本上完成前述五項步驟即可完成校時 NTP 設定,其他參數可以參考下面所列
Net time [\\\\computername | /DOMAIN:domainname]
/RTSDOMAIN[:domainname] [/set]
\\\\computername /querysntp
\\\\computername /setsntp[:ntp server list]
net time
顯示目前所在網域的時間伺服器之時間
net time \\\\computername
顯示指定機器之時間
net time /domain:domainname
顯示指定網域的網域主控站之時間
net time /domain /set
set與所在網域之網網域主控站作時間同步
net time /rtsdomain:domainname
顯示指定網域的時間伺服器之時間 (並不需要真的有一台可靠的時間伺服器)
net time /querysntp
顯示手動set的時間伺服器列表
net time /setsntp:ntpserver
手動set欲同步的校時伺服器(IP or DN)
net time /setsntp
清除所有時間伺服器setting
W32tm [-tz | -s [computer] | -adj | -adjoff | -source | -once] [-test]
[-v] [-p port] [-period freq]
-tz
Prints the local time zone information and exit.
-s computer
Forces computer (or the local computer if none is specified) to resynchronize, then exits.
-adj
Sets the computer's system clock frequency to the last frequency determined during synchronization, then exits.
-adjoff
Sets the computer's system clock frequency as the system default, then exits.
-source
Chooses a synchronization source, then exits. Note that you choose a source before each synchronization, so this is useful only in showing that a source cannot be found.
-once
Synchronizes once, and then exits. Otherwise, runs continuously as a client, synchronizing the local clock until ctrl-c is pressed.
-test
Prevents the time on the local system from being modified.
-v
Prints out a detailed description of what the program is doing. This is usually needed because otherwise the program produces no output. The exceptions are -s and -tz.
-p port
Sets the server port.
-period freq
Sets the sync period just as in the registry. (For more information, see \"W32Time Registry Entries\" later in this article). That is:
0 = once per day
65535 = once every two days
65534 = once every three days
65533 = once every week (seven days)
65532 = once every 45 minutes until you get three good
syncs, then once every eight hours (three/day)
65531 = once every 45 minutes until you get one good
sync, then once every day
Otherwise freq specifies the number of times per day. If you choose to add a value other than any of those specified above, you must use this option.
微軟參考文章
留言列表