7 events · Partly on by default · 15 MB default size
PowerShell Operational
Microsoft-Windows-PowerShell/Operational
PowerShell 5.x engine logging: module logging (4103), script block logging (4104) and script start/stop events.
Why it matters
Script block logging records the code that actually ran after de-obfuscation. Even without policy, PowerShell 5 logs script blocks it considers suspicious as Warning-level 4104 events.
Start with these
All PowerShell events
Script Execution 7
Event Viewer path
Applications and Services Logs > Microsoft > Windows > PowerShell > Operational
Turn it on, make it bigger
- GPO: Administrative Templates > Windows Components > Windows PowerShell > Turn on PowerShell Script Block Logging.
- GPO: Turn on Module Logging, with module names set to * for full coverage.
- Registry: HKLM\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging EnableScriptBlockLogging = 1
Collect this log
wevtutil epl "Microsoft-Windows-PowerShell/Operational" "C:\IR\Microsoft-Windows-PowerShell%4Operational.evtx"