Skip to content
WETNav
PowerShellScript Execution

Event ID 4105: Started invoking a command (script block)

Marks the start of execution of a script block. Pairs with 4106 to bracket when a given block actually ran.

Channel
Microsoft-Windows-PowerShell/Operational
Logged by default
No
Written on
Any host
Volume
Very high
Provider
Microsoft-Windows-PowerShell
Needs a SACL
No

To have this event

  • Script block logging with invocation logging enabled

Key fields

Exact XML field names, as they appear in <Data Name="…"> and in SIEM field extractions.

ScriptBlockIdGUID of the script block that started running; join to the 4104 that recorded its text
RunspaceIdRunspace in which the block executed
Have one of these events? Paste it into the decoder

Analyst notes

  • 014105/4106 confirm that a block logged by 4104 was executed, not merely compiled.
  • 02Very high volume when script block invocation logging is on; most analysts rely on 4104 and use 4105/4106 only to confirm execution timing.

Pull this event

Retrieval queries for a live host, a collected .evtx file and common SIEMs. Filter further on the key fields above.

Get-WinEvent -LogName 'Microsoft-Windows-PowerShell/Operational' -FilterXPath "*[System[(EventID=4105)]]" -MaxEvents 50 |
  Select-Object TimeCreated, Id, MachineName, Message

-FilterXPath supports exact matches only. For substring matching, filter in Where-Object.

ATT&CK mapping

Techniques this event can help detect. Most of these depend on specific field values; the event alone does not mean the technique happened.

Common questions

What does Windows event ID 4105 mean?
Marks the start of execution of a script block. Pairs with 4106 to bracket when a given block actually ran. It is written to the PowerShell Operational log (Microsoft-Windows-PowerShell/Operational).
Is event 4105 logged by default?
No. It must be enabled before it is recorded.
Where is event 4105 recorded?
In the Microsoft-Windows-PowerShell/Operational channel on the any host.

Marks the start of execution of a script block. Pairs with 4106 to bracket when a given block actually ran. Key fields, logging requirements, ATT&CK mapping and ready-to-run queries.