Hi everyone, I've been trying for weeks in my infrastructure to automate the shutdown of the whole ESXi structure (Vcenter-VSan-Host-VMachine etc etc ..)
I made a script using Powercli and did some tests run the script by hand and everything works perfectly until the final shutdown of the esxi hosts.
The problem comes when I want to integrate this script with ups.
My test is that when the power goes out the ups software starts the script.
This doesn't work DOES NOT start anything.
So I downloaded vSphere Management Assistant (vMA) a virtual machine which is supposed to do this job ie start scripts.
When configuring this virtual machine I get the following error:
vifp add server error ssl exception unexpected eof
Doing a Google search I found that vMAs are now deprecated ....
What do you recommend?
Thanks to those who will help me
I was talking about your original idea. I'm not familiar with Powershield but what I mean is to check the user under which it runs. For instance if it runs as SYSTEM and starts the powershell script it won't be able to connect to vCenter. Same idea as a scheduled task, it has to run as a domain account that has permissions on vCenter.
Well then the user under which the batch file runs then as it's likely the one that start Powershell uses I suppose :). You could add "whoami > c:\user.txt" somewhere in the script to find the user being used.
It works manually but does nothing when Powershield starts it which is why I'm wondering if it's even connecting to vCenter. But fair enough I won't insist down that path as you seem confident it's not it.
You could always check this terrible and outdated doc (Set-ExecutionPolicy RemoteSigned).