I have scripted AuthSync.bat to configure your Windows Server 2003 PDC emulator as the authoritative time server for your domain.

The syntax for using AuthSync.bat is:

AuthSync Seconds withIP1 \[WithIP2 WithIPn\] \[\\PDC\]


<b>Seconds</b> is the number of seconds between each external time source synchronization event.

<b>withIP<i>x</i></b> is the IP address of an external time source.

<b>\\PDC</b>   is the computer name of your Windows Server 2003 <b>PDC</b> emulator, if you run the script remotely.


AuthSync 900 \\JSI001

will cause my Windows Server 2003 PDC emulator, \\JSI001, to synchronize its' clock, using SNTP (Simple Network Time Protocol), with the the U.S. Naval Observatory, tock.usno.navy.mil ( or ntp2.usno.navy.mil (, every 15 minutes (900 seconds).

AuthSync.bat contains:

@echo off
if \{%2\}<h1><a name="_goto_syntax_set_work_1_set_a_secs_1000000_1_1000000_if_work_NEQ_secs_go_to_sece_if_secs_LSS_1_goto_sece_set_IP_2_set_IPOK_Y_call_valip_if_IPOK_EQU_N_goto_ipe_set_IPL_IP_set_PDCNAME_ASL_if_3_">\{\} goto syntax
set work=%1
set /a secs=1000000%1%%1000000
if "%work%" NEQ "%secs%" go to sece
if %secs% LSS 1 goto sece
set IP=%2
set IPOK=Y
call :valip
if "%IPOK%" EQU "N" goto ipe
set IPL=%IP%
if \{%3\}</a></h1>\{\} goto doit
set work=%3
if "%work:~0,2%" EQU "\\" goto PDC
set IP=%work%
call :valip
if "%IPOK%" EQU "N" goto ipe
set IPL=%IPL% %work%
goto ASL
if not \{%3\}==\{\} goto syntax
set OK=N
for /f "Tokens=*" %%p in ('ping -n 1 %work:~2%^|find /I "Pinging %work:~2%."') do (
 set OK=Y
If "%OK%" NEQ "Y" goto PDCNF
set PDCNAME=%work%:doit
call :doreg>nul 2>&1
goto :EOF
reg add "%PDCNAME%HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Config" /V AnnounceFlags /T REG_DWORD /D 5 /F
reg add "%PDCNAME%HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Config" /V EventLogFlags /T REG_DWORD /D 2 /F
reg add "%PDCNAME%HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Config" /V MaxNegPhaseCorrection /T REG_DWORD /D 4294967295 /F
reg add "%PDCNAME%HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Config" /V MaxPosPhaseCorrection /T REG_DWORD /D 4294967295 /F
reg add "%PDCNAME%HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Parameters" /V Log /T REG_DWORD /D 100 /F
reg add "%PDCNAME%HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Parameters" /V WriteLog /D "True" /F
reg add "%PDCNAME%HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Parameters" /V Type /D "NTP" /F
reg add "%PDCNAME%HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Parameters" /V NtpServer /D "%IPL%" /F
reg add "%PDCNAME%HKLM\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpServer" /V Enabled /T REG_DWORD /D 1 /F
reg add "%PDCNAME%HKLM\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient" /V Enabled /T REG_DWORD /D 1 /F
reg add "%PDCNAME%HKLM\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient" /V SpecialPollInterval /T REG_DWORD /D %secs% /F
goto :EOF
for /f "Tokens=1-4 Delims=." %%a in ('@echo %IP%') do (
 call :valipn %%a %%b %%c %%d
goto :EOF
set /a cnt=0
set /a cnt=%cnt% + 1
if %cnt% GTR 4 goto :EOF
set /a num=1000%1%%1000
if "%num%" NEQ "%1" goto valipe
if %num% GTR 255 goto valipe
goto valipnl
set IPOK=N
goto :EOF
@echo AuthSync - Seconds is not valid
goto :EOF
@echo AuthSync - IP address is not valid
goto :EOF
@echo AuthSync Seconds withIP1 \[WithIP2 WithIPn\] \[\\PDC\]
goto :EOF
@echo AuthSync - PDC not found