August 16, 2007

Sync Me Up Scotty!

A former work colleague phoned me the other day and asked for some advice regarding
NTP. Here’s a quick overview of the problem he faced and what I have done in the past
to move forward in this type of situation.

He has a heterogeneous, distributed environment that is not in Domain mode.He
needs to deploy client-side NTP configurations to Windows XP and Windows NT4 workstations.

Sound familiar? How can this be accomplished?

First, achieving the goal here will take two variations of the same technique: one
for the XP platform and one for the NT4 clients.

For the XP clients this change would naturally be easy via GPO. However, we are in
a distributed topology and not in domain mode. So, at least in my opinion, there is
an easier way to get it done.

Batch script using the native “w32time” command line utility. Down, dirty and simple.
Here’s the syntax:

w32tm /config /manualpeerlist:”ntp.server.com” /syncfromflags:Manual
w32tm /config /update

Note: contrary to myth, you can indeed add multiple ntp servers in the above syntax
(and in the GPO object and directly in registry). If you are using FQDN (recommended),
just enter the server names, separated by spaces. For example:

w32tm /config /manualpeerlist:”ntp.svr.com ntp.svr.com”
/syncfromflags:Manual
w32tm /config /update

Pretty straightforward but how do we get this done on the older NT4 clients?

First, download the “w32time” executable from Microsoft (ftp://ftp.microsoft.com/reskit/y2kfix/).

Edit the “w32time.ini” as necessary. However, to get this up and running, you only
need to add your NTP server(s) as values in the “NTPServer=”
space.

Then, to get the Windows time service installed and NTP running, execute the following:

COPY w32time.exe %systemroot%system32
COPY w32time.ini %systemroot%

w32time.exe -AUTOMATIC
net start w32time

Of course, there are other values that can be configured on both the XP and NT4 platforms.
Feel free to explore…

– Jason Pittman