Microsoft Defender EmailEvents KQL Guide
Looking for EmailEvents KQL queries in Microsoft Defender? This guide gives you copy-ready queries to detect spoofed sender domains, DMARC failures, suspicious delivery behaviour and real-world phishing investigation pivots.
Start with the quick query below, then move through the investigation path: sender identity, AuthenticationDetails, DeliveryAction, NetworkMessageId, URL clicks and user activity.
No theory. Just practical KQL you can use in Microsoft Defender Advanced Hunting.
EmailEvents guide summary
A practical Microsoft Defender guide for analysts and administrators who need fast EmailEvents KQL queries for spoofing, DMARC failures, suspicious delivery and click investigation pivots.
Quick Answer
What you'll learn on this page
π Quick Query: Detect Spoofed Emails in EmailEvents
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
EmailEvents
| where Timestamp > ago(30d)
| where tostring(AuthenticationDetails) has_any ("spoof", "spoofeddomain", "dmarc=fail", "spf=fail", "dkim=fail")
or tostring(ThreatTypes) has "spoof"
| project
Timestamp,
SenderFromAddress,
SenderFromDomain,
RecipientEmailAddress,
Subject,
AuthenticationDetails,
ThreatTypes,
DeliveryAction,
NetworkMessageId
| order by Timestamp desc
What EmailEvents actually tells you
EmailEvents Fields You Should Know
| Field | Why it matters |
|---|---|
| SenderFromAddress | The sender address visible to the user. |
| SenderMailFromAddress | The SMTP envelope sender used during delivery. |
| AuthenticationDetails | SPF, DKIM, DMARC and spoofing evidence. |
| DeliveryAction | Shows whether the message was delivered, blocked or quarantined. |
| NetworkMessageId | Used to pivot into UrlClickEvents and related telemetry. |
Baseline query: start with the EmailEvents story
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
EmailEvents
| where Timestamp > ago(30d)
| project
Timestamp,
SenderFromAddress,
SenderFromDomain,
SenderMailFromAddress,
SenderMailFromDomain,
RecipientEmailAddress,
Subject,
AuthenticationDetails,
ThreatTypes,
DeliveryAction,
NetworkMessageId
| order by Timestamp desc
Query: EmailEvents with authentication failures
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
EmailEvents
| where Timestamp > ago(30d)
| where AuthenticationDetails has_any ("spf=fail", "dkim=fail", "dmarc=fail", "spoof")
| project
Timestamp,
SenderFromAddress,
SenderFromDomain,
SenderMailFromAddress,
SenderMailFromDomain,
RecipientEmailAddress,
Subject,
AuthenticationDetails,
DeliveryAction,
NetworkMessageId
| order by Timestamp descQuery: sender alignment in EmailEvents
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
EmailEvents
| where Timestamp > ago(30d)
| where SenderFromDomain != SenderMailFromDomain
| project
Timestamp,
SenderFromAddress,
SenderFromDomain,
SenderMailFromAddress,
SenderMailFromDomain,
RecipientEmailAddress,
Subject,
AuthenticationDetails,
DeliveryAction
| order by Timestamp descQuery: delivered messages with suspicious authentication
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
EmailEvents
| where Timestamp > ago(30d)
| where AuthenticationDetails has_any ("spf=fail", "dkim=fail", "dmarc=fail", "spoof")
| where DeliveryAction has_any ("Delivered", "Allowed", "Junked")
| project
Timestamp,
SenderFromAddress,
SenderFromDomain,
RecipientEmailAddress,
Subject,
AuthenticationDetails,
ThreatTypes,
DeliveryAction,
NetworkMessageId
| order by Timestamp descQuery: EmailEvents campaign summary
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
EmailEvents
| where Timestamp > ago(30d)
| summarize
MessageCount = count(),
RecipientCount = dcount(RecipientEmailAddress),
FirstSeen = min(Timestamp),
LastSeen = max(Timestamp)
by SenderFromAddress, SenderFromDomain, Subject, DeliveryAction
| where MessageCount >= 3
| order by MessageCount descQuery: pivot from EmailEvents to UrlClickEvents
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
let DeliveredMessages =
EmailEvents
| where Timestamp > ago(30d)
| where DeliveryAction has_any ("Delivered", "Allowed", "Junked")
| project NetworkMessageId, EmailTime = Timestamp, SenderFromAddress, RecipientEmailAddress, Subject;
DeliveredMessages
| join kind=inner (
UrlClickEvents
| where Timestamp > ago(30d)
| project NetworkMessageId, ClickTime = Timestamp, AccountUpn, Url, ActionType
) on NetworkMessageId
| order by ClickTime descEmailEvents investigation workflow
Related Agent Foskett email investigations
Learn the KQL behind this guide
Frequently asked questions
EmailEvents is a Microsoft Defender XDR advanced hunting table used to investigate email activity, including sender details, recipient, subject, authentication evidence, delivery action, threat types and message identifiers.
Start by filtering AuthenticationDetails and ThreatTypes for spoofing, DMARC, SPF or DKIM failure signals. Then compare SenderFromDomain with SenderMailFromDomain and review DeliveryAction.
NetworkMessageId lets you pivot from EmailEvents into UrlClickEvents and other message-related evidence, helping you determine whether a delivered email led to user interaction.
Check URL clicks, sign-ins, mailbox activity, device telemetry and whether similar messages reached other users. Delivered suspicious email is where exposure and response decisions begin.
Continue your investigation
Open spoofing guide β
Review DMARC failures β
AuthenticationDetails reveals what really happened behind email delivery and user trust.
Understand authentication β
Open the full investigation guide β
Understanding this difference is critical for detecting spoofed emails.
Learn sender mismatch β
This investigation shows how a simple email can lead to wallet access and user-approved compromise.
