用Powershell强制同步Windows主机与Internet time server的时间

第一步,判断Windows Time服务是否正在运行,如果没有,则开启它。

第二步,强制同步,不知为何,往往第一次会失败,那么就多运行几次好了。


Get-Service w32time | Where {$_.status –eq 'Stopped'} |  Start-Service
W32tm /resync /force
W32tm /resync /force


参考资料

==========

https://devblogs.microsoft.com/scripting/powertip-force-time-resync-with-powershell/

https://redmondmag.com/articles/2016/01/22/powershell-to-manage-system-services.aspx

posted on 2019-05-07 11:04  中道学友  阅读(1233)  评论(0编辑  收藏  举报

导航

技术追求准确,态度积极向上