Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save jfrantz1-r7/9375bdaba7eda35af94deddd351b4cad to your computer and use it in GitHub Desktop.

Select an option

Save jfrantz1-r7/9375bdaba7eda35af94deddd351b4cad to your computer and use it in GitHub Desktop.
$query = @"
<QueryList>
<Query Id="0" Path="Microsoft-Windows-PowerShell/Admin">
<Select Path="Microsoft-Windows-PowerShell/Admin">*[System[(Level=1 or Level=2 or Level=3 or Level=4 or Level=0 or Level=5) and (EventID=4104)]]</Select>
<Select Path="Microsoft-Windows-PowerShell/Operational">*[System[(Level=1 or Level=2 or Level=3 or Level=4 or Level=0 or Level=5) and (EventID=4104)]]</Select>
</Query>
</QueryList>
"@
Get-WinEvent -FilterXML $query
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment