EventID 4104: PowerShell Script Block Logging
This event is logged to the Microsoft-Windows-PowerShell/Operational channel whenever a script is run through PowerShell.
This event will only be logged if PowerShell Script Block Logging is configured and enabled. This is a GPO setting that can be found under Administrative Templates β Windows Components β Windows PowerShell.
Analysis Value
Evidence of ExecutionParent and Child InformationFirst ExecutedFile PathSecurity IdentifierOperating System Availability
Windows 11
β
Server 2019
β
Windows 10
β
Server 2016
β
Windows 8
β
Server 2012
β
Windows 7
β
Server 2008
β
Windows Vista
β
Server 2003
β
Windows XP
β
Artifact Location(s)
%SystemRoot%\System32\Winevt\Logs\Microsoft-Windows-PowerShell%4Operational.evtx
Artifact Interpretation
System/Level
This field may indicate a suspicious script. If its value is Warning this indicates the script was flagged as suspicious based on its contents.
EventData/ScriptBlockId
This field is used to uniquely identify a script across multiple 4104 events. Large scripts may be split across multiple events, to reconstruct the full script, concatenate all the events with this unique ID together.
System/Execution/ProcessID
This field indicates the parent Process ID (PID) that executed the script.
System/Security/UserID
This field contains the SID of the user that executed the script.
Example
This example was produced on Windows 10, Version 10.0.19044 Build 19044
Last updated