asnp Citrix*
Add-PsSnapin VMware.VimAutomation.Core -ea "SilentlyContinue"
connect-viserver 127.0.0.1
do{
$servers=@()
$servers=(get-xazone|get-xaserver -onlineonly|where{($_.logonmode -eq "ProhibitNewLogOnsUntilRestart") -and ((get-xaserverload $_.servername).load -eq 0)}).servername
foreach ($server in $servers){restart-vm -vm $server -confirm:$false}
$servers=""
get-date
start-sleep -s 600
}
while ((get-xazone|get-xaserver -onlineonly|where{($_.logonmode -eq "ProhibitNewLogOnsUntilRestart")}) -ne $null)
Enjoy.
No comments:
Post a Comment