Try in Splunk Security Cloud


The following analytic detects the use of the Enable-PSRemoting cmdlet, which allows PowerShell remoting on a local or remote computer. This detection leverages PowerShell Script Block Logging (EventCode 4104) to identify when this cmdlet is executed. Monitoring this activity is crucial as it can indicate an attacker enabling remote command execution capabilities on a compromised system. If confirmed malicious, this activity could allow an attacker to take control of the system remotely, execute commands, and potentially pivot to other systems within the network, leading to further compromise and lateral movement.

  • Type: Anomaly
  • Product: Splunk Enterprise, Splunk Enterprise Security, Splunk Cloud

  • Last Updated: 2024-05-17
  • Author: Michael Haag, Splunk
  • ID: 40e3b299-19a5-4460-96e9-e1467f714f8e




ID Technique Tactic
T1059.001 PowerShell Execution
T1059 Command and Scripting Interpreter Execution
Kill Chain Phase
  • Installation
  • DE.AE
  • CIS 10
`powershell` EventCode=4104 ScriptBlockText="*Enable-PSRemoting*" 
| stats count min(_time) as firstTime max(_time) as lastTime by Computer EventCode ScriptBlockText 
| `security_content_ctime(firstTime)` 
| `security_content_ctime(lastTime)`
| `powershell_enable_powershell_remoting_filter`


The SPL above uses the following Macros:

:information_source: powershell_enable_powershell_remoting_filter is a empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Required fields

List of fields required to use this analytic.

  • _time
  • EventCode
  • ScriptBlockText
  • Computer

How To Implement

To successfully implement this analytic, you will need to enable PowerShell Script Block Logging on some or all endpoints. Additional setup here

Known False Positives

Note that false positives may occur due to the use of the Enable-PSRemoting cmdlet by legitimate users, such as system administrators. It is recommended to apply appropriate filters as needed to minimize the number of false positives.

Associated Analytic Story


Risk Score Impact Confidence Message
25.0 50 50 PowerShell was identified running a Invoke-PSremoting on $Computer$.

:information_source: The Risk Score is calculated by the following formula: Risk Score = (Impact * Confidence/100). Initial Confidence and Impact is set by the analytic author.


Test Dataset

Replay any dataset to Splunk Enterprise by using our tool or the UI. Alternatively you can replay a dataset into a Splunk Attack Range

source | version: 2