Today, I have some quick-and-easy VI Toolkit ‘Get-VIEvent’ one-liners for you. Let’s get started right away:

To get all events relating to a certain Virtual Machine, try this:

Get-VM “MyVMName” | Get-VIEvent | Format-Table CreatedTime, FullFormattedMessage -AutoSize

To get all errors from the past 24 hours, enter:

Get-VIEvent -Start (Get-Date).AddHours(-24) -Type Error | Format-Table CreatedTime, FullFormattedMessage -AutoSize

To get all errors related to a cluster, type:

Get-Cluster “MyClusterName” | Get-VIEvent -Type Error | Format-Table CreatedTime, FullFormattedMessage -AutoSize

Finally, to get all events related to DRS:

Get-VIEvent | Where {$_.FulFormattedMessage -match “DRS”} | Format-Table CreatedTime, FullFormattedMessage -AutoSize

As you can see, the possabilities are endless!
Enjoy!

»crosslinked«

Tagged with:
 

Leave a Reply