I'm using the following to measure the time offset between our domain controllers and ntp servers.
$Servers = "ntp.xxxxx,ntp.xxxxx,dc1,dc2,dc3,dca,dcb,dcc" $ListDomains = "domain1","domain2" Foreach ($Server in $ListServers) { $time = (w32tm /stripchart /dataonly /computer:$Server /samples:1)[-1].split("[")[0] "$Server`: `t $Time" #| out-file $timeFile -append $time = "" } ForEach ($Domain in $ListDomains) { "** $Domain **" w32tm /monitor /domain:"$Domain.unisa.edu.au" /nowarn /threads:5 }
This is working but the output is horrible. Domain 1
itupw-xxxxx.xxxxxxxxxxxxxx[666.666.6.76:123]:
ICMP: 0ms delay
NTP: -0.0099384s offset from itupw-xxxxx.xxxxxxxxxxxxxx
RefID: itupw-xxxxx.xxxxxxxxxxxxxx[22222222222222]
Stratum: 5
itupw-xxxxx.xxxxxxxxxxxxxx[999.666.6.76:123]:
ICMP: 0ms delay
NTP: -0.0093544s offset from itupw-xxxxx.xxxxxxxxxxxxxx
RefID: itupw-xxxxx.xxxxxxxxxxxxxx[22222222222222]
Stratum: 5
Can anyone please suggest a way of formatting this so the data is easier to compare? We're only interested in Name, ICMP, NTP(offset).
As the NTP boxes are Solaris we can't use WMI queries.
Thanks, Amelia