My goal is to write a small script to get basic information about the machine running the agent.
This is a very simple discovery procedure, we only have about 300 agents so it is a very small site.
I already can find the platform and OS from the PatrolAgent itself, but I would also like to find out serial number of the machine, model number, OS version number, patches, and a few other things accessable via WMI.
I have a vb script to pull this information from the machine, but it needs to be run locally on the machine.
My idea then is to connect a developer console (classic), load the KM and let it run the vb script and populate parameters with the results. That's why I would like to run it "inside" PSL code.
I saw some other post about the execute() psl statement does not send back StdOut text to the psl code, like I'm used to on the solaris platform.
Is my only option to write a file in the filesystem, and then have a psl collecto to parse the file ?
Or is there an easier way of doing it ?
I tried and your right the stdout doesn't go to standard out like it should (IMHO).
However the following does seem to work.
print("Output I got:".system("cscript c:\\vbs\\hello.vbs")."\n");
#what else could it possibly output as an example of code!
You should then be able to manipulate as you see fit in PSL
The output I got for my simple PSL task:
Output I got:Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.
Hope this helps
Looks like I asked the same question as in
I re-registered the psh.dll with "regsrv32 psh.dll" and my vbscript was working perfectly again.
Thanks for your help!
One thought of course is that my suggestion using system function, and cscript avoids all the problems associated with psh.dll as this simply isn't used. Everything is OS based, as far as Patrol is concerned.
Might be worth a try, and is probably more efficient than writing to file.