name: Powershell Script Block Logging 4104 id: 5cfd0c72-d989-47a0-92f9-6edc6f8d3564 version: 4 creation_date: '2024-05-22' modification_date: '2026-05-13' author: Patrick Bareiss, Splunk description: Logs detailed content of PowerShell script blocks as they are executed, including the full command text and context for the execution. mitre_components: - Script Execution - Command Execution - Process Metadata - OS API Execution - Application Log Content source: XmlWinEventLog:Microsoft-Windows-PowerShell/Operational sourcetype: XmlWinEventLog separator: EventID separator_value: '4104' supported_TA: - name: Splunk Add-on for Microsoft Windows url: https://splunkbase.splunk.com/app/742 version: 10.0.1 fields: - _time - ActivityID - Channel - Computer - EventCode - EventData_Xml - EventID - EventRecordID - Guid - Keywords - Level - MessageNumber - MessageTotal - Name - Opcode - Path - ProcessID - RecordNumber - ScriptBlockId - ScriptBlockText - SystemTime - System_Props_Xml - Task - ThreadID - UserID - Version - date_hour - date_mday - date_minute - date_month - date_second - date_wday - date_year - date_zone - dvc - dvc_nt_host - event_id - eventtype - host - id - index - linecount - punct - signature_id - source - sourcetype - splunk_server - tag - tag::eventtype - timeendpos - timestartpos - user_id - vendor_product output_fields: - dest - signature - signature_id - user_id - vendor_product - Guid - Opcode - Name - Path - ProcessID - ScriptBlockId - ScriptBlockText field_mappings: - data_model: cim data_set: Endpoint.Processes mapping: Computer: Processes.dest Path: Processes.process_path ScriptBlockId: Processes.process_id ScriptBlockText: Processes.process UserID: Processes.user_id - data_model: ocsf mapping: Computer: device.hostname Path: process.file.path ScriptBlockId: process.uid ScriptBlockText: process.cmd_line UserID: actor.user.uid example_log: 4104152150x0112748Microsoft-Windows-PowerShell/Operationalwin-dc-mhaag-attack-range-270.attackrange.local11function New-Mutex($MutexName) {