Tools / Event IDs / PowerShell Event ID 400

PowerShell Event ID 400: powershell engine started

What PowerShell Event ID 400 (powershell engine started) means, the fields to check, what is normal and what is suspicious, with PowerShell and KQL queries to find it.

Log: Windows PowerShell · Severity: Informational · MITRE ATT&CK T1059.001 · Updated 2026-11-08

Event ID 400 in the Windows PowerShell log is written every time a PowerShell engine starts. It is not exciting on its own, but its HostApplication field holds the full command line, including -EncodedCommand payloads, even on machines without script block logging. Its EngineVersion field also catches downgrade attacks: running PowerShell 2.0 to skip AMSI and script block logging, which only exist from version 5.

The fields that matter

FieldWhat it tells you
EngineVersionThe engine that started. 2.0 on a modern system almost always means someone forced a downgrade with powershell -version 2.
HostApplicationThe full command line of the host process, such as powershell.exe -nop -w hidden -enc ....
HostNameConsoleHost for powershell.exe, other values for embedded hosts such as the ISE or automation tools.
NewEngineState / PreviousEngineStateAvailable and None on start. Event 403 records the engine stopping.
RunspaceIdLinks the start with related events from the same session.

What is normal

Engine starts with EngineVersion 5.1 (or 7.x for PowerShell 7, which logs elsewhere) from admin consoles, management agents, SCCM or Intune scripts and logon scripts.

When PowerShell Event ID 400 is suspicious

Common false positive: Old management tools and legacy scripts sometimes call -version 2 on purpose. Find them and fix them, so a version 2 start becomes a reliable alert.

Find PowerShell Event ID 400 with PowerShell

Get-WinEvent -FilterHashtable @{LogName='Windows PowerShell'; Id=400; StartTime=(Get-Date).AddDays(-7)} |
  ForEach-Object {
    [pscustomobject]@{
      Time            = $_.TimeCreated
      EngineVersion   = [regex]::Match($_.Message, 'EngineVersion=(\S+)').Groups[1].Value
      HostApplication = [regex]::Match($_.Message, 'HostApplication=(.+)').Groups[1].Value.Trim()
    }
  } | Format-List

Microsoft Sentinel (KQL)

Event
| where TimeGenerated > ago(7d) and EventLog == "Windows PowerShell" and EventID == 400
| project TimeGenerated, Computer, RenderedDescription, EventData
| order by TimeGenerated desc

Related events

For a full walk-through, read How to decode and investigate encoded PowerShell commands.

FAQ

Where is PowerShell Event ID 400 logged?

In the classic Windows PowerShell log (Applications and Services Logs > Windows PowerShell), not in Microsoft-Windows-PowerShell/Operational where 4104 lives.

How do I stop PowerShell 2.0 downgrade attacks?

Remove the Windows PowerShell 2.0 feature (Disable-WindowsOptionalFeature -Online -FeatureName MicrosoftWindowsPowerShellV2Root). Recent Windows releases no longer include it, but older servers often still do.

Does Event ID 400 show the script that ran?

Only the command line in HostApplication. For the script content, turn on script block logging and read Event ID 4104.