Exporting vCenter Events with PowerCLI

Published by Christian Mohn · Read in about 1 min (163 words)

One of my clients has recently been having issues with their storage solution, and wanted to export the events from vCenter that show storage performance degradation, to aid in troubleshooting with the vendor.

For some reason, and I have yet to confirm that this is a bug with the vCenter 5.0 appliance or the vCenter Desktop Client, when an event export is done, the storage related events are not exported with the rest of the events.

Thankfully we were able to get the event details exported using the following PowerCLI oneliner:

[cc lang=“powershell” width=“95%” theme=“blackboard” nowrap=“0”] PowerCLI C:\log> Get-VIEvent -Start 19/11/2012 -Finish 30/11/2012 | Export-Csv “events.csv” -NoTypeInformation -UseCulture [/cc]

This generates an events.csv file in the current directory, containing all the events in the given timeframe, from the vCenter it is connected to. And yes, the storage related events missing from the vCenter Desktop Client export are indeed included in the file generated by the Get-VIEvent cmdlet.

Once again, PowerCLI to the rescue!

Post last updated on January 2, 2024: Add author

About

vNinja.net is the online hub of Christian Mohn and Stine Elise Larsen.

The site primarily focuses on IT architecture and data center technologies, with a strong emphasis on virtualization and related topics.
While the main content revolves around these areas, you'll also find a range of other subjects covered from time to time, reflecting the interests of authors.

Sponsors