问题描述
通过WSUS获取更新的机器,从配置了WSUS策略的测试OU挪到了生产OU里,需要验证策略生效;
于是运行gpupdate /force,报错:clock is not synchronized,在eventviewer里查看报错信息也一模一样:
最后成功的解决办法
用有本地管理员权限的域账号登录,用管理员身份打开cmd,运行net time /set
解决成功。
遗留一个问题:时间同步成功以及更新组策略成功后,运行w32tm /resync还是提示时间未同步。暂时不知道是为什么。
大致的排错过程记录
C:\Windows\system32>w32tm /stripchart /computer:1.2.3.4 #computer ip here
Tracking 1.2.3.4 [1.2.3.4:123].
The current time is 9/2/2021 10:27:21 AM.
10:27:21, d:+00.0069110s o:-54025.5631360s [@ | ]
10:27:23, d:+00.0062683s o:-54025.5634955s [@ | ]
10:27:25, d:+00.0077422s o:-54025.5629829s [@ | ]
10:27:27, d:+00.0066879s o:-54025.5631359s [@ | ]
10:27:29, d:+00.0070275s o:-54025.5637851s [@ | ]
10:27:31, d:+00.0061924s o:-54025.5632509s [@ | ]
10:27:33, d:+00.0079943s o:-54025.5624132s [@ | ]
10:27:35, d:+00.0069138s o:-54025.5635184s [@ | ]
10:27:37, d:+00.0060067s o:-54025.5633179s [@ | ]
10:27:39, d:+00.0060523s o:-54025.5631494s [@ | ]
10:27:41, d:+00.0075761s o:-54025.5637381s [@ | ]
10:27:43, d:+00.0067872s o:-54025.5634810s [@ | ]
^C
C:\Windows\system32>w32tm /resync
The following error occurred: The service has not been started. (0x80070426)
C:\Windows\system32>services.msc #启动windows time服务
C:\Windows\system32>
C:\Windows\system32>w32tm /resync
Sending resync command to local computer
The computer did not resync because no time data was available.
C:\Windows\system32>w32tm /query /source
Local CMOS Clock
C:\Windows\system32>w32tm /query /status
Leap Indicator: 3(not synchronized)
Stratum: 0 (unspecified)
Precision: -23 (119.209ns per tick)
Root Delay: 0.0000000s
Root Dispersion: 0.0000000s
ReferenceId: 0x00000000 (unspecified)
Last Successful Sync Time: unspecified
Source: Local CMOS Clock
Poll Interval: 10 (1024s)
C:\Windows\system32>netsh winsock reset #这一步其实不需要
Sucessfully reset the Winsock Catalog.
You must restart the computer in order to complete the reset.
C:\Windows\system32>w32tm /resync
Sending resync command to local computer
The computer did not resync because no time data was available.
C:\Windows\system32>net time /set
System error 5 has occurred.
C:\Windows\System32>net time /set
Current time at \\example.domain.net is 9/2/2021 3:26:22 PM
Local time (GMT+02:00) at \\example.domain.net is 9/2/2021 9:26:22 AM
The current local clock is 9/3/2021 6:26:47 AM
Do you want to set the local computer's time to match the
time at \\example.domain.net? (Y/N) [Y]: y
System error 1314 has occurred.
A required privilege is not held by the client. # 这是用域成员账号登录以及打开的cmd,之后我用本地管理员,报错是Access is denied
------------------------
domain user account, but run cmd as administrator:
C:\Windows\system32>net time /set
Current time at \\example.domain.net is 9/2/2021 3:41:02 PM
Local time (GMT+02:00) at \\example.domain.net is 9/2/2021 9:41:02 AM
The current local clock is 9/3/2021 6:41:27 AM
Do you want to set the local computer's time to match the
time at \\example.domain.net? (Y/N) [Y]: y
The command completed successfully.
C:\Windows\system32>gpupdate /force
Updating policy...
Computer Policy update has completed successfully.
User Policy update has completed successfully.