Hello,
I have seen a few pieces here about shutting down guests and hosts. I have an ancient UPS that will send a signal to windows only to shutdown. I am allowed to launch a bat/cmd file .I was wondering if it is feasible to use the powershell toolkit to connect to VC, and for each host there - shutdown all running vms followed by shutdown the host.
My plan, so far is :
http://geekswithblogs.net/Lance/archive/2007/02/16/106518.aspx
gets me to logn without clear text credentials
PowerShell -PSConsoleFile "C:\Program Files\VMware\Infrastructure\VIToolkitForWindows\mysettings.psc1" -command .\powerdown.ps1
Thepowershell script would have
something that lists vm'guests on host| shutdown-vmguest should get my vm's powered down
get-viserver -server $HS = Find-EntityView -ViewType "HostSystem" $HS.ShutdownHost("false")
This gets my host shutown
Is there a way to list all hosts attached to VC? I'd like to make it so that each host added later behaves the same way without having to add to the script.
Advice/experience appreciated
Regards
Paul Flynn