DET-102 · human · confidence High

PowerShell Script Logging

Module, script block, and transcription logging record what PowerShell ran.

These logs are off by default and set by Group Policy. Script Block Logging (Event 4104) captures the code, including decoded content. Module Logging records pipeline details. Transcription saves input and output to text files. For insiders they show data collection scripts, mass file reads, mail exports, and attempts to clear history. Send them centrally and protect the transcript share.

Data sources
PowerShell Operational log (4103, 4104)Transcript files
Platforms
Windows

Logic

EventCode=4104
| search ScriptBlockText IN (*Compress-Archive*, *Get-ChildItem -Recurse*, *Invoke-WebRequest*, *Remove-Item*PSReadLine*, *Export-Mailbox*, *New-MailboxExportRequest*)
| table _time host UserID ScriptBlockText

False positives

Admin scripts and software deployments. Allowlist by signed script hash.

Catches 17 techniques