Cristian Livadaru's blog

... think again ...

Windows XP NTP With OPSI

UPDATE 2013-01-12: Works with Win7 as well

I have a couple of Windows XP connected to a Windows Domains which runs UCS and OPSI. My problem was that Windows XP always had a wrong time due to the fact that the user has no permission to change the time and the logon script is executed with user permission. But since there is also OPSI, why not create a OPSI Package which runs with admin permissions. After a bit of google search I came across a OPSI package from mozilla. Unfortunately it didn’t really help. The values where all set as expected but XP still refused to update. After some more reading of the w32time parameters I came up with a working [OPSI] package

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
[Initial]
Message=Set Time Servers
StayOnTop=false

[Aktionen]
Registry_set_time_servers
Winbatch_disable_appletimesrv
Winbatch_resync_w32tm

[Registry_set_time_servers]
openkey [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters]
set "NTPServer"=REG_SZ:"192.168.0.2,0x1"
set "Type"=REG_SZ:"NTP"

[Winbatch_disable_appletimesrv]
sc config AppleTimeSrv start= disabled
sc stop w32time
sc start w32time

[Winbatch_resync_w32tm]
w32tm /config /update /manualpeerlist:192.168.0.2 /syncfromflags:MANUAL