Event Log Management

PowerShell has a terrific cmdlet in Get-Eventlog that makes it easy to find information in a system's event log. Since different systems may have different event logs, one of the first commands you'll want to use is this.

To get you started, here are five examples to type at the PS prompt type:

  1. get-command
  2. get-command *event
  3. get-Eventlog system
  4. get-Eventlog system -newest 100
  5. get-Eventlog system -newest 100 | where {$_.eventid -eq 20}
  6. get-eventlog -list
  7. get-eventlog powershell -newest 5 |format-list
  8. get-eventlog System -newest 5 |where {$_.EventID -eq 7036}
  9. $logs=get-eventlog System |where {$_.EventID -eq 7036}