======Microsoft - Windows - Time Service======
=====Documentation=====
[[http://technet.microsoft.com/en-us/library/cc773061.aspx|Microsoft TechNet - Windows Time Service Technical Reference]] \\
=====Blogs=====
[[http://blogs.msdn.com/w32time/default.aspx|MSDN Blogs - Windows Time Service]] \\
=====Blogposts/Articles=====
[[http://blogs.msdn.com/b/w32time/archive/2008/02/28/configuring-the-time-service-enabling-the-debug-log.aspx|MSDN Blogs > Windows Time Service > Configuring the Time Service: Enabling the Debug Log]] \\
[[http://blogs.technet.com/askds/archive/2007/10/23/high-accuracy-w32time-requirements.aspx|TechNet Blogs - Ask the Directory Services Team - High Accuracy W32time Requirements]] \\
[[http://www.beaglesoft.com/clwaw32time.htm|Beagle Software - Using the Windows Time Service (w32time) while running ClockWatch as an SNTP Timeserver]] \\
[[http://www.cl.cam.ac.uk/~mgk25/mswish/ut-rtc.html|IBM PC Real Time Clock should run in UT]] \\
=====Microsoft Support KB articles======
[[http://support.microsoft.com/kb/223184/en-us|Registry entries for the W32Time service]] \\
[[http://support.microsoft.com/kb/939322/en-us|Support boundary to configure the Windows Time service for high accuracy environments]] \\
[[http://support.microsoft.com/kb/884776/en-us|How to configure the Windows Time service against a large time offset]] \\
[[http://support.microsoft.com/kb/830092/en-us|In Windows Server 2003 and in Windows XP, W32Time frequently logs Event ID 50, and poor time synchronization occurs]] \\
[[http://support.microsoft.com/kb/224799/en-us|Basic Operation of the Windows Time Service]] \\
[[https://support.microsoft.com/en-us/kb/816043|How to turn on debug logging in the Windows Time Service (KB816043)]] \\
[[https://support.microsoft.com/en-us/kb/262680|A list of the Simple Network Time Protocol (SNTP) time servers that are available on the Internet (KB262680)]] \\
=====Enable logging for the W32Time service=====
Import:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w32time\Parameters]
"WriteLog"="True"
"Log"=dword:00000064
And restart the Windows Time service. \\
Source:[[http://support.microsoft.com/kb/307937/en-us|Microsoft Support - Configuring the Time Service to Log When the Time Is Changed]] \\
=====0x1, 0x2, 0x4, 0x8, etc.=====
As suffix to the name or the IP address of:
* /manualpeerlist: (w32tm)
* /setsntp (net time)
You can add an extra value for the NTP packet type:
|0x01|SpecialInterval|
|0x02|UseAsFallbackOnly|
|0x04|SymmatricActive|
|0x08|Client|
Sources: \\
[[http://support.microsoft.com/kb/816042/en-us|Microsoft Support - How to configure an authoritative time server in Windows Server (KB816042)]] zie onder "More Information".\\
[[http://technet.microsoft.com/en-us/library/cc773263(WS.10).aspx|TechNet - Windows Time Service Tools and Settings]] see the description of the NtpServer registry key. \\
=====Configure standalone Windows Server as NTP Server=====
// Tested on Windows Server 2012 R2 Standard. //
REM Configure the Windows Time service to sync with two NTP servers
"%SYSTEMROOT%\system32\w32tm.exe" /config /manualpeerlist:"0.nl.pool.ntp.org 1.nl.pool.ntp.org " /syncfromflags:manual /reliable:yes /update
REM Configure the Windows Time service to auto-start
"%SYSTEMROOT%\system32\sc.exe" config W32Time start=auto
REM Enable the NTP Server component of W32Time
REM http://www.techrepublic.com/blog/the-enterprise-cloud/configure-a-standalone-ntp-server-in-windows-server/
"%SYSTEMROOT%\system32\reg.exe" ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpServer" /v Enabled /t REG_DWORD /d 1 /f
REM Stop and start the Windows Time service.
"%SYSTEMROOT%\system32\sc.exe" stop W32Time
"%SYSTEMROOT%\system32\sc.exe" start W32Time
REM Query config
"%SYSTEMROOT%\system32\w32tm.exe" /query /configuration
REM Add a firewall rule allowing UDP/123 incoming
%systemroot%\system32\netsh.exe advfirewall firewall add rule name="NTP Server" dir=in action=allow protocol=UDP localport=123
REM If this is a domain member server, Windows Time service shows "Automatic (Trigger Start)" as status in services.msc.
REM https://www.coretechnologies.com/products/ServiceTriggerEditor/sc.html
REM Check trigger parameters
"%SYSTEMROOT%\system32\sc.exe" qtriggerinfo W32Time
REM Remove the trigger parameters
"%SYSTEMROOT%\system32\sc.exe" triggerinfo W32Time delete
Sources:
* [[http://www.techrepublic.com/blog/the-enterprise-cloud/configure-a-standalone-ntp-server-in-windows-server/|TechRepublic - Configure a standalone NTP server in Windows Server]]
* [[https://www.coretechnologies.com/products/ServiceTriggerEditor/sc.html|Core Technologies Consulting - Using SC to manage Service Triggers on Windows 10/8/7 and Windows Server 2016/2012/2008 R2]]