The debug log is a powerful tool in the W32Time bag of tricks when you need to figure out why something isn't working. The debug log tell you (for better or worse) what the Time Service is doing under the hood. Where it is connecting to, how long it is waiting between polls, etc.
In Windows Vista/Server 2008, we added the /debug option to the w32tm.exe command. This is the quickest and easiest way to configure the time service, and should be used if possible. A secondary option (if you are running XP/W2k3) is to edit the settings in the registry. Both will have the same effect, but using the w32tm command will keep you from having to get your hands dirty with registry editing. We will take a look at the w32tm command first:
Using the w32tm.exe command
To enable the w32time debug logging:
w32tm /debug /enable /file:C:\windows\temp\w32time.log /size:10000000 /entries:0-300
The command uses the following options:
Turning off the debug log is just as easy:
w32tm /debug /disable
Using the registry
In essence, the w32tm.exe command shown above does exactly what we are about to do here. The only real difference is that when you use w32tm, it handles the reloading of the config, which will actually apply the values found in the registry. Since we will now be making the changes ourselves, we will need to reload the config ourselves.
Note: If you just want a quick .reg file that you can modify and merge, skip to the bottom of this post.
To get started, fire up the Windows registry editor:
Start -> Run -> Regedit.exe
Next, browse to the w32time config key, where we keep all of the w32time configuration:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config
Here, you will be creating the following three keys (if they do not exist):
Once they are created, go ahead and add the values that you want.
Once you apply the changes to the registry, you need to tell the w32time service that it needs to re-read the configuration information. To do this, you can use the following command:
w32tm /config /update
Example .reg file
Here is an example .reg file you can modify to simplify the process:
As usual, If you have specific thoughts or questions about this post, please feel free to leave a comment. For general questions about w32time, especially if you have problems with your w32time setup, I encourage you to ask them on Directory Services section of the Microsoft Technet forums.