Get-Winevent Powershell Cmdlet Cheat Sheet: Where To Acquire
Get-Winevent Powershell Cmdlet Cheat Sheet: Where To Acquire
Get-Winevent Powershell Cmdlet Cheat Sheet: Where To Acquire
Abstract
Where to Acquire
PowerShell is natively installed in Windows Vista and newer, and includes the Get-WinEvent
cmdlet by default.
Examples/Use Case
Get-WinEvent
View all events in the live security Event Log (requires administrator PowerShell):
View all events in the file example.evtx, format list (fl) output:
1/4
PS C:\> Get-WinEvent -FilterHashtable @{Path="system.evtx";
ID=7030,7045}
Search for events containing the string "USB" in the file system.evtx:
'grep'-style search for lines of events containing the case insensitive string "USB" in the file
system.evtx:
Pull all errors (level=2) from application.evtx and count the number of lines ('wc'-style):
AppLocker
Pull all AppLocker logs from the live AppLocker event log (requires Applocker):
2/4
Search for live AppLocker EXE/MSI block events: "(EXE) was prevented from running":
Search for live AppLocker EXE/MSI audit events: "(EXE) was allowed to run but would have
been prevented from running if the AppLocker policy were enforced":
EMET
Pull all EMET logs from the live Application Event log (requires EMET):
Pull all EMET logs from a saved Application Event log (requires EMET):
Sysmon
Pull all Sysmon logs from the live Sysmon Event log (requires Sysmon and an admin
PowerShell):
3/4
Windows Defender
Pull Windows Defender event logs 1116 and 1117 from the live event log
Pull Windows Defender event logs 1116 (malware detected) and 1117 (malware blocked)
from a saved evtx file
Additional Info
A printable PDF version of this cheatsheet is available here:
Get-WinEvent
4/4