Link to home
Start Free TrialLog in
Avatar of Manuel Boosch
Manuel Boosch

asked on

Powershell Script with HP Power Protector


i have an VMWare Environment with 2 x ESXi Host in a HA-Cluster. This Environment is connected to a HP 3000 UPS with a HP UPS MGMT Module. I have installed a W2012R2 VM running on this Cluster and installed HP Power Protector ver. 1.04 on this VM.

Now i wrote a powershell script for shutting down the VMWare vSphere HA-Cluster and this script (c:\temp\ups.ps1) is running fine if i run it locally on my W2012R2 VM.

Now i set the HPPP to run a script and set it up for the path "powershell c:\temp\ups.ps1". But it does not work when i use the "Test Shutdown" Button - as mentioned before the script is running fine when i start it manually.

I wrote a test script with the only information to restart the vm:

shutdown -r -t 00

saved this one to c:\temp\ups1.ps1.

Now i inserted this one in HPPP as script path "powershell c:\temp\ups1.ps1". Pressing the "Test Shutdown" button now works and restarts the VM directly.

Why it does not work with the other script in HPPP ? Im loading the VMWare Snapin at the beginning of my script to use PowerCLI commands..

Is there anything i missed ?
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

many things like execution policy
powershell c:\temp\ups.ps1 change this to
c:\windows\system32\WindowsPowershell\v1.0\Powershell.exe -executionpolicy bypass c:\temp\ups.ps1
Can you provide the script?
you said you already had the script but couldn't execute it my instructions are the ways to make it execute
I'm not the OP :)
Avatar of Manuel Boosch
Manuel Boosch

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Use the askers solution