Need help to use w32tm collecting the Time Source
Hi!
I have a customer with lot of computers that are out of sync with time.
The diff could be as much as 15 minutes (900 seconds).
The computers are non-domain computers. The Computers runs Windows 7 (Embedded).
The computers are set up and supposed to use a server in the on-premise network for time-sync. But that does not seem to work.
I want to find out what Time Source the computers are really using.
For collecting the computers current time, I tried this command: "w32tm /stripchart /computer:time.windows.com /dataonly /Samples:1"
I created a package and deployed it to a few computers using PDQ Deploy. The deployments of the package worked as planned, but the only thing I am missing, is ONE output file, with all the info from the w32tm command.
PDQ Deploy, by default, makes one output file for each computer the package are deployed to. So If I deploy a package to 100 computers, PDQ Deploy makes 100 output files (one .qz file for each computer).
So, I hope you could help me how to use w32tm.exe with PDQ Deploy, or PDQ Inventory -> Command (PS or CMD). And also get ONE output file with all the info from the w32tm command, in it.
The dream is to get this result, in the output file:
<ComputerName> <Time Source>
<ComputerName> <Time Source>
<ComputerName> <Time Source>
<ComputerName> <Time Source>
<ComputerName> <Time Source>
Any help is appreciated :o)
PS: If you have another ideas, other than using PDQ, to get the same result I want. Feel free to suggest other methods.
Maybe a scan profile can be used? I don't know :p
Hope to hear from you.
Best regards,
Kenneth
Comments
a few thoughts:
Have you tried piping the output to a centralized file? For example, using ">> \\sevrer\share\outputfile.txt" at the end of the command? The ">>" indicates to pipe the output to a file and two of the signs ">>" (as opposed to one ">") means to append the file.
Second, your command doesn't match the output you're looking for. The command you're issuing is looking for time offset - but what you seem to want, from your sample is just the name of the PC and the name of the time server it's using to sync time.
Is this a one time thing or something to do regularly? While not perfect, you could do something like this:
echo %computername%~ && w32tm /query /source >> \\server\share\output.txt
It will output the following:
PC#1~
timeserver.whatever.com
PC#2~
wrongtime.whatever.com
etc. etc.
If this is a one time thing, once you get all the output in a single file, you could use Notepad++ to strip Tilde & CRLF and replace with TAB.What you'd end up with is:
PC#1 timeserver.whatever.com
PC#2 wrongtime.whatever.com
etc.
Not elegant but gets the job done quickly. If this were a report you need to rerun regularly, I'd have to play in dos a little more.
You could also probably do it in Powershell and use Powershell to strip the Tilde & CRLF.
Again, not super elegant, but will get the job done. Run this from PDQI