VBScript is supported, is supported you can use the PSL execute function, but note the recent posting about a library not being properly registered on the latest version of Patrol Agent.
What are you looking to do with your VBScript?.
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 ?
1 of 1 people found this helpful
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 very promising!
I have now tried to use "PSL Here" code in my collector, because the vbs code became too many lines.
I have also tried to write a text file from vb to c:\temp to be able to parse the file using the cat command later.
But I will also try your suggestion.
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!
Hmm, it looks like it's not working on Windows 2008 either.
The solution to reregister the dll isn't scaling to hundreds of servers.
I need to find another solution. Or wait another year to have all my agents reinstalled with a new (fixed) patrol version.
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.