← Back to SOC feed Coverage →

Exchange PowerShell Snapin Added (Normalized Process Events)

kql MEDIUM Azure-Sentinel
T1119
imProcessCreate
backdoorhuntingmicrosoftofficialpowershell
This rule was pulled from an open-source repository and enriched with AI. Validate in a test environment before deploying to production.
View original rule at Azure-Sentinel →
Retrieved: 2026-04-21T09:00:00Z · Confidence: medium

Hunt Hypothesis

The hypothesis is that an adversary may be leveraging the Exchange PowerShell Snapin to execute malicious commands and gain unauthorized access to Exchange servers. SOC teams should proactively hunt for this behavior in Azure Sentinel to detect potential compromise of email infrastructure and prevent data exfiltration or lateral movement.

KQL Query

imProcessCreate
 | where Process has_any ("cmd.exe", "powershell.exe", "PowerShell_ISE.exe")
 | where CommandLine has "Add-PSSnapin Microsoft.Exchange.Management.Powershell.Snapin"
 | summarize FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated) by Dvc, User, CommandLine, EventVendor, EventProduct
 | extend timestamp = FirstSeen, AccountCustomEntity = User, HostCustomEntity = Dvc

Analytic Rule Definition

id: 9ccb1859-7a79-4a8a-a382-fa54d4dace47
name: Exchange PowerShell Snapin Added (Normalized Process Events)
description: |
  'The Exchange Powershell Snapin was loaded on a host, this allows for a Exchange server management via PowerShell.
  Whilst this is a legitimate administrative tool it is abused by attackers to performs actions on a compromised
  Exchange server. Hunt for unusual activity related to this Snapin including it being added on new hosts or by
  new accounts.'
requiredDataConnectors: []
tactics:
  - Collection
relevantTechniques:
  - T1119
query: |
  imProcessCreate
   | where Process has_any ("cmd.exe", "powershell.exe", "PowerShell_ISE.exe")
   | where CommandLine has "Add-PSSnapin Microsoft.Exchange.Management.Powershell.Snapin"
   | summarize FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated) by Dvc, User, CommandLine, EventVendor, EventProduct
   | extend timestamp = FirstSeen, AccountCustomEntity = User, HostCustomEntity = Dvc
entityMappings:
  - entityType: Account
    fieldMappings:
      - identifier: FullName
        columnName: AccountCustomEntity
  - entityType: Host
    fieldMappings:
      - identifier: FullName
        columnName: HostCustomEntity

Required Data Sources

Sentinel TableNotes
imProcessCreateEnsure this data connector is enabled

MITRE ATT&CK Context

References

False Positive Guidance

Original source: https://github.com/Azure/Azure-Sentinel/blob/main/Hunting Queries/ASimProcess/imProcess_ExchangePowerShellSnapin.yaml