Windows Server 2019 Active Directory (AD域)时间不同步的解决方法

摘要:
2.启用NTPServerHKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesW32TimeTimeProviderNtpServer,将键Enabled的值修改为十进制的1。快速将所有注册表导入WindowsRegistryEditorVersion5.00[HHKEY_LOCAL_MACHINESOFTWARE MicrosoftWindowsCurrentVersionDateTimeServers]@=“0”“0”=“ntp.dtops.cc”[HHKEY_LOCAL_ MACHINESYSTEMCcurrentControlSetServicesw32timeParameters]“NtpServer”=“ntp.dtops.cc”“Type”=“ntp”[HHKEY_ LOCAL_MACCHINESYSTEMCCurrentControlSetServiceSW32timeProviders NtpClient]“SpecialPollInterval”=Dwood:0000258[HHKEY_LOCAL_MACHINESYSTEMCcurrentControlSetServicesw32timeConfig]“AnnounceFlags”=dword:000000a[HHKEY_LOCAL_ MACHINESSYSTEM EMCcurrentControlsetServicesw32TimeTimeProviderNtpServer]“Enabled”=dword:0000001 5。配置组策略,将时间同步设置为1。打开组策略管理,Win+R调用运行窗口并输入gpedit.msc以打开组策略2计算机配置管理模板系统Windows时间服务,双击全局配置设置并选择启用。
Windows Server 2019 Active Directory (AD域)时间不同步的解决方法

 

1)首先确认虚拟化底层的时间是否准确,因为所有虚拟机会自动同步虚拟主机的时间。

2)在所有AD服务器上开启时间同步功能

一、找到适合的NTP服务器

首先需要找一个适合自己网络环境的NTP服务器,因为不同的网络会有不同的NTP服务器起作用,检测NTP服务器的方法为在AD上运行w32tm /stripchart /computer:以下NTP服务器的名字,如

w32tm /stripchart /computer:ntp.dtops.cc #若是可以使用会显示如下图

Windows Server 2019 Active Directory (AD域)时间不同步的解决方法

若是不可用会显示如下图:
Windows Server 2019 Active Directory (AD域)时间不同步的解决方法

二、CMD命令指定NTP服务器

找到适合自己网络的可用NTP服务器后,假设找到s1a.time.edu.cn为可用NTP服务器,在AD服务器上开启时间同步,运行如下命令

PS C:Windowssystem32> w32tm /config /manualpeerlist:ntp.dtops.cc /syncfromflags:manual /reliable:yes /update
PS C:Windowssystem32> w32tm /config /update
PS C:Windowssystem32> net stop w32time
PS C:Windowssystem32> net start w32time
PS C:Windowssystem32> w32tm /resync /rediscover
PS C:Windowssystem32> w32tm /query /source

Windows Server 2019 Active Directory (AD域)时间不同步的解决方法

三、设置主域控制器与国家授时中心服务器时间同步,同步周期为1天。

1、 添加时间服务器

Win+R 调出运行窗口输入 regedit 打开注册表

注册表:HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionDateTimeServers在右边窗口点右键新建“字符串值”,将此“字符串值”命名为0。双击此新建的“字符串值”,输入:ntp.dtops.cc,保存。将“默认”(即第一个“字符串值”)修改为0即可,删除其他所有的值只保留如图所示的值
Windows Server 2019 Active Directory (AD域)时间不同步的解决方法

2、 指定时间源

HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesW32TimeParameters,修改键NtpServer的值为ntp.dtops.cc
Windows Server 2019 Active Directory (AD域)时间不同步的解决方法

3、 设置校时周期

HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesW32TimeTimeProvidersNtpClientSpecialPollInterval 修改键SpecialPollInterval的值为十进制的600(即为600秒,10分钟)
Windows Server 2019 Active Directory (AD域)时间不同步的解决方法

四、设置权威服务器

1、 设置权威服务器

在域控服务器上打开注册表,找到键值

HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesW32TimeConfig 修改键AnnounceFlags的值为十进制的10。
Windows Server 2019 Active Directory (AD域)时间不同步的解决方法

2、 启用 NTPServer

HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesW32TimeTimeProvidersNtpServer,修改键Enabled的值为十进制的1
Windows Server 2019 Active Directory (AD域)时间不同步的解决方法

所有注册表快速导入

Windows Registry Editor Version 5.00
 
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionDateTimeServers]
@="0"
"0"="ntp.dtops.cc"
 
[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesw32timeParameters]
"NtpServer"="ntp.dtops.cc"
"Type"="NTP"
 
[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesw32timeTimeProvidersNtpClient]
"SpecialPollInterval"=dword:00000258
 
 
[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesw32timeConfig]
"AnnounceFlags"=dword:0000000a
 
[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesw32timeTimeProvidersNtpServer]
"Enabled"=dword:00000001

五、配置组策略,设置时间同步

1、 打开组策略管理,Win+R 调出运行窗口输入 gpedit.msc 打开组策略管理
Windows Server 2019 Active Directory (AD域)时间不同步的解决方法

2、 计算机配置—管理模板—系统—Windows时间服务,双击“全局配置设置”,选择“已启用”。
Windows Server 2019 Active Directory (AD域)时间不同步的解决方法

修改MaxNegPhaseCorrection的值为600(即为600秒,10分钟)修改MaxPosPhaseCorrection的值为600(即为600秒,10分钟)修改AnnounceFlags的值为5点“应用”,“确定”。
Windows Server 2019 Active Directory (AD域)时间不同步的解决方法

3、 计算机配置—管理模板—系统—Windows时间服务—时间提供程序,“启用Windows NTP客户端”,选择“已启用”。
Windows Server 2019 Active Directory (AD域)时间不同步的解决方法

“配置Windows NTP客户端”,选择“已启用”。修改NtpSever的值为ntp.dtops.cc,修改Type的值为NTP,修改SpecialPollInterval的值为600(10分钟)
Windows Server 2019 Active Directory (AD域)时间不同步的解决方法

4、cmd命令在域控和客户端完成检测

域控上运行下面三条命令检测,返回成功执行了命令即为成功。若是返回此计算机没有重新同步,因为没有可用的时间数据。请排查上述文档中一步时间服务器是否可用,和五-4步服务器是否正确,看w32tm /query /source命令返回的结果是否正确。

PS C:Windowssystem32> gpupdate /force         #更新组策略
PS C:Windowssystem32> w32tm /query /source        #查看时间服务器是否为更改过的ntp.dtops.cc
PS C:Windowssystem32> w32tm /resync /rediscover   #手工同步时间

Windows Server 2019 Active Directory (AD域)时间不同步的解决方法

域内的客户端想要同主域时间同步,执行下面的命令,返回成功执行了命令即为成功

PS C:Windowssystem32> gpupdate /force           #更新组策略
PS C:Windowssystem32> w32tm /resync /rediscover    #手动同步时间

Windows Server 2019 Active Directory (AD域)时间不同步的解决方法

强制同步主域服务器时间的方法

PS C:Windowssystem32> net time \172.25.106.22 /SET /y

Windows Server 2019 Active Directory (AD域)时间不同步的解决方法

注意时间若想成功同步,时间不能跟标准时间差别太大,在范围内的才能成功同步。

1、系统时间比标准时间系统时间晚14小时59分钟之内

2、系统时间比标准时间早30分钟之内

NTP服务器参考
210.72.145.44  (国家授时中心服务器IP地址)
ntp.sjtu.edu.cn 202.120.2.101 (上海交通大学网络中心NTP服务器地址)
s1a.time.edu.cn北京邮电大学
s1b.time.edu.cn清华大学
s1c.time.edu.cn北京大学
s1d.time.edu.cn东南大学
s1e.time.edu.cn清华大学
s2a.time.edu.cn清华大学
s2b.time.edu.cn清华大学
s2c.time.edu.cn北京邮电大学
s2d.time.edu.cn西南地区网络中心
s2e.time.edu.cn西北地区网络中心
s2f.time.edu.cn东北地区网络中心
s2g.time.edu.cn华东南地区网络中心
s2h.time.edu.cn四川大学网络管理中心
s2j.time.edu.cn大连理工大学网络中心
s2k.time.edu.cn CERNET桂林主节点
s2m.time.edu.cn 北京大学
 
Africa — africa.pool.ntp.org (53)
Antarctica — antarctica.pool.ntp.org (0)
Asia — asia.pool.ntp.org (298)
Europe — europe.pool.ntp.org (2967)
North America — north-america.pool.ntp.org (960)
Oceania — oceania.pool.ntp.org (128)
South America — south-america.pool.ntp.org (61)

3)对于有些客户端Windows Times服务会自动停止,可以尝试重新注册一下此服务项

1.首先,运行如下命令删除时间服务:

W32tm /unregister

2.然后,再运行如下命令加载默认时间配置服务:

W32tm /register

4、开启w32tm debug模式并打印日志到文件的方法

w32tm /debug /enable /file:c:w32time.log /size:10000000 /entries:0-116   #开启方法
w32tm /debug /disable 关闭方法

免责声明:文章转载自《Windows Server 2019 Active Directory (AD域)时间不同步的解决方法》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇uni-app 安卓和IOS更新方案uni.showModal,uni.showToast使用下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

JAVA代码时间SFTP文件的下载

参考文章:http://blog.csdn.net/smallerpig/article/details/50976191 SFTP文件的下载与FTP文件的下载差别较大,需要下载jsch-0.1.54jar包 package com.cd.util; import com.jcraft.jsch.JSchException;...

一次SQLServer数据库宕机问题

数据库采用SQL Server 2005版本, 数据库文件约为6G,而LDF日志文件已经高达36G。 服务器开始变的不太稳定 。数据没有成功保存。 打开事件查看器发现很多信息日志 数据库 '' 中的文件 '_log' 的自动增长已由用户取消,或已在 30031 毫秒后超时。请使用 ALTER DATABASE 为此文件设置较小的 FILEGROWTH 值...

ntp的中级知识

ntp启动参数-g什么意思?为什么误差超过1000s ntpd会异常退出?-x参数又是什么意思? 如何缓慢调整ntp? 机器本地如何守时? 如果ntp校准不回来怎么办? adjtimex修改tick值用法举例 chrony和ntp区别? adjtimex和时钟的几个概念tick,freq,ppm? Linux上夏时令是什么?夏时令到了我们需要做什么吗?...

linux 修改时区不生效

起因:服务器时间改成莫斯科时区后,再改回来出现问题。改不回来了,date后显示还是莫斯科时间,看了好多帖子都无效,例如:https://www.west.cn/docs/52635.html 最终解决办法:从其他机器拷贝2个文件覆盖该机器对应的路径: /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 再dat...

kudu安装部署

安装部署节点规划 节点 kudu-master kudu-tserver node01 是 是 node02 是 是 node03 是 是 配置本地Yum的Repository 下载kudu安装yum源。并配置安装yum源 [root@hadoop03soft]# wget http://archive.clouder...

Win10自动更新有效强制永久关闭

服务中关闭Win10自动更新 1、使用 Win + R 组合快捷键,打开运行对话框,输入命令services.msc ,点击下方的“确定”打开服务,如下所示。  2、在Win10服务设置中找到 Windows Update 选项,双击打开,如下所示。  3、然后在Windows Update属性设置中,将启动类型改为 禁用,点击下方的停止,再点击底部的...