I want to run some powershell scripts to check some stuff. Those powershell scripts I want to trigger from a scheduled task vbscript policy. The vbscript looks like this.
Set objShell = WScript.CreateObject("WScript.Shell")
objShell.Run("Powershell -NoProfile -ExecutionPolicy Bypass -File ""C:\ProgramData\HP\HP BTO Software\bin\instrumentation\HP_MailboxMounted.ps1"""), , True
If I have understood correctly. WScript object is not available when running vbscript from hp agent. How can I make this work?
There is an Enhancement Request to support Powershell in OMW as follow:
The suggested workaround its to:
" Wrapping Powershell commands inside of VBScript Shell commands."
Hope this information helps.
Thanks and Regards,
If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution
If you liked it I would appreciate KUDOs
I guess wrapping the powershell into vbscript is what I am attempting to do, but without success. :(
Does there exist some documentation on how to write vbscript to use in hp OM policies?
For OMW the reference guide it's the Online Help .
Other way is to look at the bundled policies and see how they are implemented.
Also there are some topics which may help for example:
Change Wscript.CreateObject to Policy.CreateObject
Set objShell = Policy.CreateObject("WScript.Shell")
Hope this helps you ..
Below are few references :