域内主机会自动同步域服务器的时间,可有时候发现服务器的时间不对了,连锁反应就来了。 方法1: 运行gpedit.msc 打开本地策略组(Winserver2012和2016应该是一样的),路径为:计算机配置->管理模板->系统->Windows 时间服务: 1.1配置Windows NTP客户端 (ntp服务器一般用 ntp.windows.com或ntp.aliyun.com) 1.2.启用Windows NTP客户端 1.3.重启 Windows time服务 1.4 更新组策略 :gpupdate /force 方法二:查询时间源C:\WINDOWS\system32>w32tm /query /status Leap 指示符: 3(未同步) 层次: 0 (未指定) 精度: -23 (每刻度 119.209ns) 根延迟: 0.0000000s 根分散: 0.0000000s 引用 ID: 0x00000000 (未指定) 上次成功同步时间: 未指定 源: Local CMOS Clock 轮询间隔: 10 (1024s) 查询ntp服务器
查看本机是否为ntp 服务器C:\WINDOWS\system32>reg query HKLM\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpServer
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpServer AllowNonstandardModeCombinations REG_DWORD 0x1 ChainDisable REG_DWORD 0x0 ChainEntryTimeout REG_DWORD 0x10 ChainLoggingRate REG_DWORD 0x1e ChainMaxEntries REG_DWORD 0x80 ChainMaxHostEntries REG_DWORD 0x4 DllName REG_EXPAND_SZ %systemroot%\system32\w32time.dll Enabled REG_DWORD 0x0 EventLogFlags REG_DWORD 0x0 InputProvider REG_DWORD 0x0 RequireSecureTimeSyncRequests REG_DWORD 0x0
**ntp server 的 Enabled REG_DWORD 0x0 说明不为ntp server, **修改为1,可为ntp server 查询与外部ntp服务器联通性
设置与外部ntp同步w32tm /config /syncfromflags:MANUAL /manualpeerlist:'ntp.aliyun.com,0x09' /reliable:YES /update 使配置生效
立即同步如果上述设置后,时间差距较大,不能立即同步,可以执行以下命令来同步 w32tm /resync 报以下错误 首先,运行如下命令删除时间配置:
然后,再运行如下命令加载默认时间配置 W32tm /register 官方文档
|
|