June 4, 2017

Get VM's affected by HA Events - since Yesterday

Login to vCenter using PowerCLI
Run Below command ,  it will give you HA rebooted VMs within Past Day..

$Date=Get-Date
$HAVMrestartold=1
Get-VIEvent -maxsamples 100 -Start ($Date).AddDays(-$HAVMrestartold) -type warning | Where {$_.FullFormattedMessage -match "restarted"} |select CreatedTime,FullFormattedMessage |sort CreatedTime -Descendin

No comments:

Post a Comment