Windows time sync/PDC questions We have 7 sites with 1 to 2 DCs per site and 2 domains, domaincom and childdomaincom I noticed the time on all machines in the Child domain are drifting from the PDC in the Parent domain, currently by almost 2 minutes I dug into it and found our setup is like this (blue are the PDC's for the domains, the XType net time /querysntp, or;W32tm /query /status Or check event log (note – it can take a few seconds to take effect) The first command above is telling the Windows Time service to acquire time from a a list of internet servers specified in "manualpeerlist" In this example I'm using my local time server for someone living in the Northeast, USA
Fast Troubleshooting For Windows Time Service W32time Synchronization
W32tm /query /status command
W32tm /query /status command-If you want to know what your domain controllers Time Server configuration is you can run two simple command line query's Open a CMD prompt;W32tm /query Now that the Windows Time Service is registered and running, you can get information from it You can do this by typing the following w32tm /query and match it with the following parameters /status This will show you the status of Windows Time Service /status /verbose This will set the verbose mode to show you more information
W32tm /query /source returns Local CMOS Clock w32tm /query /peers returns #Peers 1 Peer State Pending Time Remaining s Mode 0 (reserved) Stratum 0 (unspecified) PeerPoll Interval 0 (unspecified) HostPoll Interval 0 (unspecified) w32tm /resync /rediscover returns The computer did not resync because no time data was availableTo see the SystemClockRate and pollIntervalInSeconds values (measured in seconds), open a Command Prompt window and then run W32tm /query /status /verbose This command produces output that resembles the following The output presents the poll interval in both clock ticks and in secondsThe steps below can be used to configure a windows server or desktop computer to query an external NTP server such as poolntporg 7 Steps total Step 1 Info This is generally performed on DCs in an Active Directory domain Then all workstations use AD to get time from the DCs
W32tmexe is the command line tool for configuring, monitoring, or troubleshooting the Windows Time service It allows you to configure Windows Time Service (W32time) settings such as changing the NTP server or forcing a synchronization You can also use W32tmexe to diagnose problems with the time service It replaces the net time commandW32tmexe is the preferred commandline tool for configuring, monitoring, or troubleshooting the Windows Time service w32tm /query /status gives you information such as stratum leap indicator precision last sync NTP server poll interval So, that's all in this blogIf I tried to run the following from a command prompt w32tm /query /status I would get Access is denied (0x) If I tried to run If I tried to run the following from a command prompt w32tm /query /configuration I would also get Access is denied (0x) The fix for me was to do the following (Don't skip the reboots or this
W32tm /query /status After this command you will see result Leap Indicator 0(no warning) Stratum 2 (secondary reference – syncd by (S)NTP) Precision 6 (ms per tick) Root Delay s Root Dispersion s ReferenceId 0xD8E500 (source IP PDC IP address) Last Successful Sync Time 949 Source PDC FQDN,0x1W32tm /query /peers w32tm /query /status w32tm /query /configuration w32tm /query /source I configured the PDC to sync to external sources and made sure it was set to be a reliable source Example NTP peer list for a PDCCheck Windows event logs and "w32tm /query" commands to make sure time sync is working fine 4 Reset NTP Registry Settings to the Default There might be some situation when you need to reset NTP related registry settings to Windows default values;
This PowerShell Workflow is part of PowerShell module for Time Synchronization on Windows and Windows ServerTo get all features you need all PowerShell Workflows from the Time Sync module Possibilities Get information from the local server or from multiple remote servers in parallel;W32tm /query /status As we can see in this case this pc/server is using a "free" source to sync time Now before start, we have to create a GPO to force domain's client to sync with the PDC's role holder netdom query fsmo The PDC is where we need to forse clients to sync GPO for CLIENTS settingBetter use status option w32tm /query /status Leap Indicator 0(no warning) Stratum 5 (secondary reference syncd by (S)NTP) Precision 6 (ms per tick) Root Delay s Root Dispersion
Below are the full details of the W32TM commandlet which has been the standard since Windows Vista and Windows Server 08 and still function in Server 12 R2Check status c\w32tm /query /status Will show the new time "Source" To check sync is working c\w32tm /resync (Check the time sync) See an advert of interest, click it, this site is funded by ad clicksW32tm /query /status You can also see what peers (sources) it is set for by using the command w32tm /query /peers In this instance, its source is "Freerunning System Clock" If it is in this state or "Local CMOS clock" and the machine exists as a virtual machine on VMware ESXi or Microsoft HyperV then it may be temporary
W32tm /query /status w32tm /debug net time /querysntp w32tm /config /update w32tm /query /source w32tm /query /status w32tm /query /source Your Windows client systems are joined to the WestSimcom domain To ensure correct time stamps are used, you need to verify that these clients are configured for the appropriate time zoneHello, We have a windows time service on a windows 7 client that is unable to sync with the time server The status is as shown below here C\Windows\system32>w32tm /query /peers #Peers 1 Peer <our peer>By default the Windows Time service ( w32time) will synchronize it's time once per week This can be extended to daily by setting a Scheduled Task to start the service and run w32tm /resync The options /debug, /packetinfo and /ipprotocol are available from Windows Vista and above
14 rowsYou can also use W32tmexe to diagnose problems with the time service W32tmexe is the preferred commandline tool for configuring, monitoring, or troubleshooting the Windows Time service For examples of how you can use this command, see Examples Syntax W32tm </parameter>不調の時 w32tm /query /statusを実行し、ソースがLocal CMOS Clockと表示される場合は、ハードウェアのクロックに同期している。 参照先のNtpServerを設定してすぐは、上記が表示される場合があるが、一度、同期が実行されると、レジストリに設定したNtpServerの値が表示されるので、しばらく待つ。If all you are looking for is the status, use the W32tm command with the /query and /status switches w32tm /query /status
This is the most important part of the moduleThen I run a w32tm /query /status and generally get something like this as a response Two completely different domains and servers respond with the source Local CMOS Clock Leap Indicator 0 (no warning) Stratum 1 (primary reference syncd by radio clock) Precision 6 (ms per tick) Root Delay s Root Dispersion sUse the command below w32tm /config /reliableyes 5 Start the Windows Time service net start w32time 6 You can check the status using the command below w32tm /query /configuration w32tm /query /status w32tm /query /peers If you completely screwed up the config, you can always do the following command and it will completely erase and add
The output of your w32tm /query /configuration shows that the Windows Time service settings are being managed by Group Policy You need to make your desired changes in the GPO that's being used to configure the Windows Time service – joeqwerty Nov 9 '19 at 235 2W32tm /query /status will say that Poll Interval 10 (1024s), but I cannot confirm that requests for every 1024 seconds (or less) It simply does not do that There is a TechNet article with the title of Windows Time Service Tools and Settings describing a registry setting of MaxPollInterval located in HKEY_LOCAL_MACHINE\SYSTEMW32tm /query /status Microsoft Windows – PowerShell – w32tm /query /status output Show Configuration w32tm /query /configuration Microsoft Windows – PowerShell – w32tm /query /configuration output Linux 1 ntpdate q domainNameOrIpaddress ntpdate q timewindowscom
The w32tm /query /status command also shows the machine's time source, as well as other potentially useful information The /verbose switch provides even more information As with the first command, these switches are only available on machines running Windows Vista or laterW32tm /query /computer {/source /configuration /peers /status} /verbose This parameter was first made available in the Windows Time client versions of Windows Vista, and Windows Server 08 Displays a computer's Windows Time service information computer—Query the information of If a value is not specified, the default value isW32tm /query /status w32tm /query /status /verbose ← check offset w32tm /resync Restart Windows Time
W32tm /query /peers w32tm /query /status w32tm /query /configuration w32tm /query /source I configured the PDC to sync to external sources and made sure it was set to be a reliable source Example NTP peer list for a PDCTime Service Utility The Windows Time service (W32Time) is designed to maintain date and time synchronization for computers running client and server versions of Microsoft Windows The primary use for such time synchronization is to ensure the security of Kerberos authentication within an Active Directory environment including virtual machinesW32tm /query /configuration gives you the configuration you have set up w32tm /query /status gives you information such as stratum leap indicator precision last sync NTP server poll interval time /T outputs the current system time
State pending time remaining s Mode 0 (reserved) Stratum 0 Type w32tm /query /status;Then I start the W32Time (Windows Time) service because the w32tm command requires it As you can see, all parts of the code that can possibly generate an exception are enclosed in Try / Catch block because I do not want to stop the execution of the script, and I want to have information about any exception in the ErrorEvents property of the
11 Run w32tm /query /status and w32tm /query /source to check everything is working 12 On all other domain controllers run below commands to sync from PDC a w32tm /config /syncfromflagsdomhier /update b w32tm /query /source – It should show your PDCHi, Does the issue only occur on one Windows 7 client?W32tm /query /peers returns #Peers 1 Peer State Pending Time Remaining s Mode 0 (reserved) Stratum 0 (unspecified) PeerPoll Interval 0 (unspecified) HostPoll Interval 0 (unspecified) We executed the following steps to reconfigure windows time service on the Windows 08 R2 Domain controller and that fixed our time issue
Following are the commands – >net stop w32time >w32tm /unregister >w32tm /register >netNow type w32tm /resync /rediscover to force a new time synchronization with the configured time server for the domain The command completed successfully Run the w32tm /query /status command again to see where the time is now coming from Your computer's time is now coming from the domain controller in the Fabrikam domain as expectedDr Scripto May 27th, 15 Summary Use Windows PowerShell to find the status of the time service How can I use Windows PowerShell to find the status of the time service on my local computer?
W32tm /query /status To configure the PDC Emulator with an external NTP server or hardware appliance for that matter, just use the bellow command line and execute it Off course, you will need to replace the NTP servers with the ones that exist in your region or if you are using a hardware appliance with it's FQDN or IP addressAfter running w32tm /query /status I found that the source was set to local CMOS clock on the domain client machine I tried the standard fix to update client to domain w32tm /config /syncfromflagsdomhier /update net stop w32time net start w32time But that didn't work and neither did any of the other suggestions I triedW32tm /query /status /verbose gives me Leap Indicator 3(last minute has 61 seconds) Stratum 0 (unspecified) Precision 6 (ms per tick) Root Delay s Root Dispersion s ReferenceId 0x (unspecified) Last Successful Sync Time unspecified Source Local CMOS Clock Poll Interval 6 (64s) Phase Offset s
W32tm /query /peers The output of this command also shows a mode for each specified server/peer, which should be 3 (Client) in most cases For other options of the w32tm command please see the usage information displayed if the command is run without any parameter