windows 同步其他windows时间 w32time
一、介绍
在windows平台下有w32time服务,w32time服务有两种模式:服务器模式、客户端模式,默认只开启客户端模式,用于和其他的时间服务器同步。作为时间服务器,需要开启服务器模式。
二、服务器设置
1. 修改注册表
键值HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesW32TimeTimeProvidersNtpServer内的「Enabled」设定为1,打开NTP服务器功能 。
键值HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesW32TimeConfigAnnounceFlags设定为5.该设定强制主机将它自身宣布为可靠的时间源。
2. 重启Win32Time服务
net stop w32Time
net start W32Time
三、客户端设置
w32tm /register net stop w32time net start w32time w32tm /config /manualpeerlist:192.10.10.1 /syncfromflags:manual /update w32tm /resync
w32tm /register 注册为系统服务 net stop w32time 停止服务 net start w32time 启动服务 w32tm /config /manualpeerlist:192.10.10.1 /syncfromflags:manual /update 定义同步IP w32tm /resync 同步
