none
Get-Winevent from multiple logs RRS feed

  • Question

  • Hi,

    Is it possible to grab events from two logs in the same query? I am converting these to html and need them to be in the same table.

    Get-WinEvent  -FilterHashTable @{LogName="System"}  | ?{$_.LevelDisplayName -eq "Critical" -or $_.LevelDisplayName -eq "Error"} | Select @{Name="Time";Expression={$_."TimeCreated"}},@{Name="Level";Expression={$_."Level"}}

    Get-WinEvent  -FilterHashTable @{LogName="Application"}  | ?{$_.LevelDisplayName -eq "Critical" -or $_.LevelDisplayName -eq "Error"} | Select @{Name="Time";Expression={$_."TimeCreated"}},@{Name="Level";Expression={$_."Level"}}

    I have tried the below and nothing gets pulled unless I run them separately.

    Get-WinEvent  -FilterHashTable @{LogName="System","Application"}

    Get-WinEvent  -FilterHashTable @{Listlog="*"}

    Get-WinEvent  -Listlog *

    Thanks

    Thursday, October 20, 2016 1:04 AM

Answers

  • Get-WinEvent  -FilterHashTable @{LogName='System','Application'} 

    \_(ツ)_/

    • Marked as answer by RackHat Friday, October 21, 2016 7:45 PM
    Thursday, October 20, 2016 3:36 AM

All replies