You can use View PowerCLI cmdlets to display event reports.

Table 1. Examples of Common Event Reporting Tasks

Task

Example View PowerCLI cmdlet Syntax

List all the available event reporting views

Get-EventReportList

Display all the configuration change events that occurred after a specific date

Get-EventReport -viewName config_changes -startDate (Get-Date -Year 2011 -Month 5 -Day 20 -Hour 0 -Minute 0 -Second 0)

Display all the user events that occurred between two specific dates

Get-EventReport -viewName user_events -startDate (Get-Date -Year 2011 -Month 12 -Day 1 -Hour 0 -Minute 0 -Second 0) -endDate (Get-Date -Year 2011 -Month 12 -Day 2 -Hour 0 -Minute 0 -Second 0)

Display all the user events that occurred during for the last 24 hours

Get-EventReport -viewName user_events -startDate ((Get-Date).AddDays(-1))

Display all the user events that occurred during the current year

Get-EventReport -viewName user_events -startDate (Get-Date -Day 01 -Month 01 -Hour 0 -Minute 0 -Second 0)