1.NTP简介
①windows server系统不需要安装NTP,Windows Server 默认情况下已经内置了时间同步功能,可以通过 Windows Time 服务(w32time)来自动同步时间。
②多台域控服务器下,负责时间同步是:PDC模拟操作主机的DC进行。但是注意:客户端的电脑不是都同步PDC,而是随机同步其中一台。
③Windows 域环境中的时间同步是分布式的,而不是集中式的。即使有PDC操作主机,也没有必要所有客户端都直接与其同步时间。Windows 操作系统使用一种称为 "Windows Time Service"(W32Time)的服务来实现时间同步,该服务使用了一种分层次的时间同步结构,其中域控制器之间相互同步时间
2.NTP常用命令
//强制同步域控NTP的时间 net time /domain /set //强制同步域控NTP的时间 w32tm /resync
//指定同步哪台特定的NTP服务器
w32tm /config /syncfromflags:manual /manualpeerlist:"time.windows.com"
注:time.windows.com :NTP服务器的名称
//如何指定更新NTP源并马上生效
w32tm /config /manualpeerlist:"x.x.x.x" /syncfromflags:manual /reliable:YES /update
//x.x.x.x为NTP服务器的地址
//清除指定NTP服务器恢复默认
w32tm /config /syncfromflags:domhier /reliable:YES /update
//查看本机跟NTP的同步源
w32tm /query /source
//查看本机同步源NTP详细信息
w32tm /query /status