Systems Management (OpenView-OP Mgmt) Practitioners Forum
cancel

scheduled task - vbscript policy

Highlighted
Roar Simon
Respected Contributor.

scheduled task - vbscript policy

Hi

 

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.

 

Dim objShell

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?

 

Thanks

Roar

5 REPLIES
Carlos_Pinto
Outstanding Contributor.

Re: scheduled task - vbscript policy

Hello,

 

There is an Enhancement Request to support Powershell in OMW as follow:

 

 

http://support.openview.hp.com/selfsolve/document/LID/QCCR1A100049

 

The suggested workaround its to:

 

" Wrapping Powershell commands inside of VBScript Shell commands."

 

 

Hope this information helps.

 

Thanks and Regards,

Carlos Pinto

 

HP Support

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

Carlos Pinto
Roar Simon
Respected Contributor.

Re: scheduled task - vbscript policy

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?

Carlos_Pinto
Outstanding Contributor.

Re: scheduled task - vbscript policy

Hello,

 

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:

 

http://h30499.www3.hp.com/t5/Systems-Management-OpenView-OP/OMW-8-16-calling-powershell-script-from-Logfile-Plilicy/m-p/5255393#M157231

 

http://h30499.www3.hp.com/t5/Systems-Management-OpenView-OP/powershell-script-in-scheduled-task-policy-omw-8/td-p/5246183#.Ux8bdU2p2JI

 

http://h30499.www3.hp.com/t5/Systems-Management-OpenView-OP/OVOW-support-of-Powershell/td-p/4607361#.Ux8bmk2p2JI

 

 

 

Hope this information helps.

 

Thanks and Regards,

Carlos Pinto

 

HP Support

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

Carlos Pinto
m_vidyasagar
Acclaimed Contributor.

Re: scheduled task - vbscript policy

 

Change Wscript.CreateObject to Policy.CreateObject

 

Dim objShell

Set objShell = Policy.CreateObject("WScript.Shell")

objShell.Run("Powershell -NoProfile -ExecutionPolicy Bypass -File ""C:\ProgramData\HP\HP BTO Software\bin\instrumentation\HP_MailboxMounted.ps1"""), , True

 

Hope this helps you ..

- Vidyasagar Machani -

Tell me and I forget. Teach me and I remember. Involve me and I learn. -- Benjamin Franklin
m_vidyasagar
Acclaimed Contributor.

Re: scheduled task - vbscript policy