{"id":602,"date":"2016-01-20T00:00:20","date_gmt":"2016-01-20T00:00:20","guid":{"rendered":"http:\/\/www.edwardsd.co.uk\/work\/?p=602"},"modified":"2020-02-17T13:49:57","modified_gmt":"2020-02-17T13:49:57","slug":"windows-time-service-wont-sync-with-time-windows-com","status":"publish","type":"post","link":"https:\/\/www.edwardsd.co.uk\/work\/2016\/01\/windows-time-service-wont-sync-with-time-windows-com\/","title":{"rendered":"Windows Time Commands | Cheatsheet"},"content":{"rendered":"<p><strong>Check time service is running (Local &amp; Remote):<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">sc query w32time<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">sc \\\\HOSTNAME query w32time<\/pre>\n<p><strong>Displays&nbsp;all local time information (Local &amp; Remote):<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">w32tm \/query \/configuration<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">w32tm \/query \/configuration \/computer:HOSTNAME<\/pre>\n<p><strong>Display Windows Time service status (Local &amp; Remote):<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">w32tm \/query \/status<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">w32tm \/query \/status \/computer:HOSTNAME<\/pre>\n<p><strong>Display Windows Time service source (Will return one line: local CMOS vs Server) (Local &amp; Remote):<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">w32tm \/query \/source<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">w32tm \/query \/source \/computer:HOSTNAME<\/pre>\n<p><strong>Display a list of peers and their status:<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">w32tm \/query \/peers<\/pre>\n<p><strong>Displays current time (local source)<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">Time \/T<\/pre>\n<p><strong>Resync local computer time against time server:<\/strong>&nbsp;(run on all servers, except time server)<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">w32tm \/resync \/rediscover <\/pre>\n<p><strong>Force local computer time to update against domain server (Local &amp; Remote):<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">w32tm \/config \/syncfromflags:domhier \/update\r\nw32tm \/resync \/rediscover w32tm \/resync<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">w32tm \/config \/syncfromflags:domhier \/update \/computer:HOSTNAME\r\nw32tm \/resync \/rediscover w32tm \/resync<\/pre>\n<p><strong>Start time server via CLI (Local &amp; Remote)<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">net start w32time<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">SC \\\\HOSTNAME net start w32time<\/pre>\n<p><strong>Restore Windows Time Service (if it has been broken)<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nnet stop W32Time\r\nw32tm \/unregister\r\nw32tm \/register\r\nnet start W32Time\r\nsc query W32Time\r\n<\/pre>\n<p><strong>Set Time Update NTP source<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n@echo off\r\nnet stop w32time\r\nw32tm \/config \/syncfromflags:manual \/manualpeerlist: 0.uk.pool.ntp.org\r\nw32tm \/config \/reliable:yes\r\nnet start w32time\r\nw32tm \/query \/peers\r\nPAUSE\r\n<\/pre>\n<hr \/>\n<p><strong>Event Viewer Error Message:<\/strong><\/p>\n<p><em>Event Type: Error&nbsp;<\/em><\/p>\n<p><em style=\"line-height: 1.71429; font-size: 1rem;\">Event Source: W32Time&nbsp;<\/em><\/p>\n<p><em> Event Category: None&nbsp;<\/em><br \/>\n<em> Event ID: 12<\/em><\/p>\n<p><em> Description: Time Provider NtpClient: This machine is configured to use the domain hierarchy to determine its time source, but it is the PDC emulator for the domain at the root of the forest, so there is no machine above it in the domain hierarchy to use as a time source. It is recommended that you either configure a reliable time service in the root domain, or manually configure the PDC to synchronize with an external time source. Otherwise, this machine will function as the authoritative time source in the domain hierarchy. If an external time source is not configured or used for this computer, you may choose to disable the NtpClient.<\/em><\/p>\n<p><strong>To resolve the eventID 12:<\/strong><\/p>\n<ul>\n<li><code>w32tm \/register<\/code><\/li>\n<\/ul>\n<p><strong>Reference:&nbsp;<\/strong><\/p>\n<ul>\n<li lang=\"en-US\"><a href=\"http:\/\/pool.ntp.org\" target=\"_blank\" rel=\"noopener noreferrer\">pool.ntp.org<\/a><\/li>\n<li><a href=\"http:\/\/support.microsoft.com\/kb\/816042\" target=\"_blank\" rel=\"noopener noreferrer\">How to configure an authoritative time server in Windows Server<\/a><\/li>\n<li><a href=\"https:\/\/technet.microsoft.com\/en-us\/library\/cc773263(v=ws.10).aspx\" target=\"_blank\" rel=\"noopener noreferrer\">Windows Time Service Tools and Settings<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Check time service is running (Local &amp; Remote): sc query w32time sc \\\\HOSTNAME query w32time Displays&nbsp;all local time information (Local &amp; Remote): w32tm \/query \/configuration w32tm \/query \/configuration \/computer:HOSTNAME Display Windows Time service status (Local &amp; Remote): w32tm \/query \/status w32tm \/query \/status \/computer:HOSTNAME Display Windows Time service source (Will return one line: local CMOS [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[29,18,23,44,51,54,20],"tags":[],"class_list":["post-602","post","type-post","status-publish","format-standard","hentry","category-windows-7","category-windows-server-2003","category-windows-server-2008","category-windows-server-2012","category-windows-server-2016","category-windows-server-2019","category-windows-vista"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pOPt8-9I","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.edwardsd.co.uk\/work\/wp-json\/wp\/v2\/posts\/602","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.edwardsd.co.uk\/work\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.edwardsd.co.uk\/work\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.edwardsd.co.uk\/work\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.edwardsd.co.uk\/work\/wp-json\/wp\/v2\/comments?post=602"}],"version-history":[{"count":13,"href":"https:\/\/www.edwardsd.co.uk\/work\/wp-json\/wp\/v2\/posts\/602\/revisions"}],"predecessor-version":[{"id":3604,"href":"https:\/\/www.edwardsd.co.uk\/work\/wp-json\/wp\/v2\/posts\/602\/revisions\/3604"}],"wp:attachment":[{"href":"https:\/\/www.edwardsd.co.uk\/work\/wp-json\/wp\/v2\/media?parent=602"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.edwardsd.co.uk\/work\/wp-json\/wp\/v2\/categories?post=602"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.edwardsd.co.uk\/work\/wp-json\/wp\/v2\/tags?post=602"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}