Difference between revisions of "Time synchronization"
m |
|||
Line 37: | Line 37: | ||
<install cmd='net time \\yourntpserver /set /yes' /> | <install cmd='net time \\yourntpserver /set /yes' /> | ||
− | <install cmd='COMSPEC% /c w32tm /config /update /manualpeerlist:"yourntpserver,0x8 0.pool.ntp.org,0x2 1.pool.ntp.org,0x2" /syncfromflags:MANUAL' /> | + | <install cmd='%COMSPEC% /c w32tm /config /update /manualpeerlist:"yourntpserver,0x8 0.pool.ntp.org,0x2 1.pool.ntp.org,0x2" /syncfromflags:MANUAL' /> |
<upgrade cmd='net time \\yourntpserver /set /yes' /> | <upgrade cmd='net time \\yourntpserver /set /yes' /> |
Revision as of 07:46, 24 February 2011
This one synchronizes time on a Windows workstation against some other Windows machine (i.e., domain controller etc.).
<package
id="time"
name="Time Synchonization"
revision="1"
reboot="false"
priority="100"
notify="false"
execute="always">
<install cmd="net time \\timeserver /set /yes" />
</package>
If you're using WPKG Client, it's a good idea to put just net time \\timeserver /set /yes
in a "pre" script.
This command succeeds and works even if your date is off by a lot(unlike normal NTP).
Net Time Plus NTP
This package performs a net time sync plus it also sets your domain NTP server as the primary NTP source and configures ntp.org pool servers as fallback NTP sources. The latter is worthwhile for laptop users who aren't necessarily logged on to your domain.
The hex flag 0x8 after the primary NTP server means use standard NTP client behaviour, the hex flag 0x2 designates the NTP server as a fallback to be used if the primary is not available.
<package
id="time"
name="Time Synchonization"
revision="1"
reboot="false"
priority="100"
notify="false"
execute="once">
<install cmd='net time \\yourntpserver /set /yes' />
<install cmd='%COMSPEC% /c w32tm /config /update /manualpeerlist:"yourntpserver,0x8 0.pool.ntp.org,0x2 1.pool.ntp.org,0x2" /syncfromflags:MANUAL' />
<upgrade cmd='net time \\yourntpserver /set /yes' />
<upgrade cmd='%COMSPEC% /c w32tm /config /update /manualpeerlist:"yourntpserver,0x8 0.pool.ntp.org,0x2 1.pool.ntp.org,0x2" /syncfromflags:MANUAL' />
</package>