Exporting vCenter events on vCenter 7.0 using PowerCLI
search cancel

Exporting vCenter events on vCenter 7.0 using PowerCLI

book

Article ID: 328221

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

This article provides steps to export events on vCenter Server 7.0 to text format with using PowerCLI cmdlets.   vSphere 7.0 has HTML5-version vSphere Client UI only and doesn't have WebClient UI, and HTML5-version vSphere Client UI doesn't have the feature to export events and tasks which WebClient had.

Resolution

To export events on vCenter Server 7.0 to text format:

1. Install PowerCLI from the Powershell Gallery if it is not yet installed.
PS> Install-Module -Name VMware.PowerCLI
2. Change the security policy.
PS> Set-ExecutionPolicy RemoteSigned
3. Connect to FQDN or IP of the target vCenter Server
PS> Connect-VIServer -Server <VC-FQDN or VC-IP> -User '[email protected]'
4. Specfiy the date range and get events (dates below are examples).
PS> Get-VIEvent -Start 2020-04-01 -Finish 2020-04-07 > events.txt
5. Disconnect.
PS> Disconnect-VIServer

The -Start and -Finish options are required unless retrieving only the latest 100 events. The event type values (Type = "Information", "Warning", "Error", ...) will not appear in the output text file, so the FullFormattedMessage field must be read to determine the event severity.

Additional Information