The PowerShell Operational Log is the Windows event log Microsoft-Windows-PowerShell/Operational. When script block logging is enabled it records executed PowerShell code as event ID 4104, often revealing obfuscated code after decoding. Defenders hunt it for encoded commands, download cradles and offensive tooling, since attackers favour PowerShell for execution and post-exploitation.
What the PowerShell Operational Log captures
The Microsoft-Windows-PowerShell/Operational log is the native Windows event stream defenders use to see PowerShell activity that would otherwise be difficult to reconstruct. When script block logging is enabled, it records executed code, including the 4104 event, which can expose the real command after decoding or deobfuscation. That makes it one of the most useful sources for understanding what PowerShell actually did on a host.
Because PowerShell is both a legitimate administration tool and a common attacker execution path, the log sits at the boundary between routine administration and suspicious activity. It is especially valuable when offensive tooling uses encoded commands, download cradles, or layered scripting to hide intent from simpler process-level telemetry.
Why defenders rely on it
Operational PowerShell telemetry fills a visibility gap that process creation alone often cannot close. A command line may show only a short launcher, while the operational log can reveal the script content, intermediate function calls, and multi-line content that was split across blocks. That is why hunters use it to spot living-off-the-land execution and to understand the sequence behind post-exploitation activity.
The log becomes even more useful when paired with related controls such as transcription, module logging, and endpoint telemetry. Together they help defenders reconstruct execution context, correlate suspicious script content with user or service activity, and distinguish normal automation from abuse.
What good logging visibility looks like
Useful PowerShell logging is not just “turned on” or “off”. Organisations need to know whether the relevant policy is actually applied across endpoints and servers, whether 4104 events are being retained long enough for investigation, and whether the telemetry reaches a central collection point before local logs roll over or are cleared. Coverage matters because gaps are often exploited on the systems that matter most.
PowerShell Logging Detection Guide expands the operational use of script block, module and transcription logs into SOC detections, including tamper-aware monitoring and reassembly of split script blocks. For defenders who need a broader fileless-malware view, Fileless Malware Guide shows how PowerShell logging fits into detecting living-off-the-land tradecraft.
How to use it in investigations
In an investigation, the log is most valuable when treated as evidence of execution rather than a standalone alert source. A suspicious 4104 event should be read alongside parent process, network activity, script origin, and whether the command arrived through a console, remoting channel, scheduled task, or another launcher. That context helps separate administrative automation from malicious staging.
Analysts also use the log to look for patterns: encoded payloads, reflective loading, download cradles, credential access tooling, and repeated small script blocks that assemble a larger attack chain. When those patterns appear, the next step is usually to determine whether the activity was opportunistic abuse or part of a broader intrusion.
Risk and Threat Considerations
PowerShell is attractive to attackers because it is built into Windows, widely trusted, and capable of launching follow-on activity without introducing obvious new binaries. If logging is incomplete, disabled, or inconsistently collected, defenders lose a key source for spotting encoded commands, hidden script content, and the early stages of post-exploitation.
Failure mechanism: Attackers can use obfuscation, split script blocks, or native administration features to execute payloads while reducing the value of simple command-line review, then exploit logging gaps to stay less visible.
Impact: Missed or delayed detection can leave compromise undiagnosed longer, increase the chance of persistence and lateral movement, and make later forensic reconstruction much harder.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
MITRE ATT&CK addresses the attack and risk surface, while CIS Controls v8, NIST SP 800-53 Rev 5 and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| CIS Controls v8 | CIS-8 — Audit Log Management | PowerShell operational logs are audit telemetry used to detect hostile execution. |
| Recommendation — Collect, retain, and review PowerShell logs for suspicious execution and tampering. | ||
| NIST SP 800-53 Rev 5 | AU-2 — Audit Events | PowerShell Operational Log records audit events for script execution and investigation. |
| AU-6 — Audit Record Review, Analysis, and Reporting | The log supports analysis of executed PowerShell code and attacker tradecraft. | |
| Recommendation — Define PowerShell events to audit and ensure they are centrally collected. Review PowerShell audit records for encoded commands and post-exploitation activity. | ||
| MITRE ATT&CK | T1059.001 — PowerShell | This log is commonly used to detect and investigate PowerShell execution by adversaries. |
| Recommendation — Map suspicious PowerShell logging evidence to T1059.001 and hunt for related activity. | ||
| NIST CSF 2.0 | DE.CM-01 — Continuous Monitoring | The log is a monitoring data source for detecting malicious or anomalous PowerShell activity. |
| Recommendation — Continuously monitor PowerShell telemetry for anomalous or malicious execution. | ||
Practitioner Guidance
Why practitioners should care: Treat the PowerShell operational log as a primary investigation source, not a secondary convenience. If your environment relies on PowerShell for administration, the quality of this telemetry directly affects detection depth and incident reconstruction.
What to watch for: Verify that script block logging is consistently enabled where it matters, that central collection is working, and that alerts account for encoded content, repeated block fragments, and suspicious download or staging patterns. The most useful logging is the logging you can actually search during an incident.
Related resources from NHI Mgmt Group
- When does log retention become an operational risk instead of a harmless archive?
- Who is accountable when security detections, log outputs, or sensor onboarding changes affect operational visibility?
- Why does unverified Groovy, PowerShell, or integration code create outsized operational risk?
- Why does attribute-based routing reduce noise and operational cost in Windows log pipelines?
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on November 26, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org