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«

Related posts:

  1. Calculate vSphere 5 Licenses with Powershell (UPDATED)
  2. Remove vmware memory limits with Powershell

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

   
© 2012 PeetersOnline Suffusion theme by Sayontan Sinha