Office 365 Message Trace (Graph API)
Overview
Microsoft 365 Message trace follows email messages as they travel through your Exchange Online organization. You can determine if a message was received, rejected, deferred, or delivered by the service. It also shows what actions were taken on the message before it reached its final status. You can use the information from message trace to efficiently answer user questions about what happened to messages, troubleshoot mail flow issues, and validate policy changes (More information on microsoft.com).
Warning
Important note - This format is currently in beta. We highly value your feedback to improve its performance.
- Vendor: Microsoft
- Supported environment: Cloud
- Version compatibility:
- Detection based on: Telemetry
- Supported application or feature:
Prerequisite
According to docs.microsoft.com, Message Trace is available to the following plans :
- Exchange Online Protection
- Microsoft Defender for Office 365 plan 1 and plan 2
- Microsoft 365 Defender
Configure
Provision the Microsoft application
In order to access message traces in the Microsoft Graph API, you must provision the Microsoft application 8bd644d1-64a1-4d4b-ae52-2e0cbf64e373.
- Log in the Azure Portal
-
Open the cloud shell

-
If you use the bash cloud shell, switch to the Powershell one. Click confirm in the modal.


-
Paste this command to connect to the Microsoft Graph Powershell
Connect-MgGraph -Scopes "Application.ReadWrite.All" -
Paste this command to provision the service principal
New-MgServicePrincipal -AppId 8bd644d1-64a1-4d4b-ae52-2e0cbf64e373
Configure OAuth
Collect your Tenant ID from your Azure Portal(for more information read How to find your Microsoft Entra ID (Azure AD) tenant ID).
Create an Azure application
- On the Azure Portal, in the search bar, go to
App registrations - Click
+ New registration - Type a name
- Select
Accounts in this organizational directory onlyoption as account type - Click
Register - From the
Overviewpage, copyApplication (client) IDandDirectory (tenant) ID
Create a client secret
- Go to
Manage>Certificates & secrets - Click
+ New client secret - Type a description and select the desired expiration period
- Click
Add - Copy the
Valueof the client secret
Add permissions
- Go to
Manage>API permissions - Click
Add a permission - On the right panel, Select
Microsoft APIstab - Click
Microsoft Graph - Click
Application permissions - Select the permission:
ExchangeMessageTrace.Read.All - Click
Add permissions - In the
API permissionspage, clickGrant admin consent for TENANT_NAME - Click
Yesin theGrant admin consent confirmationmodal
Create an intake
Go to your Sekoia.io Intakes page, and follow these steps:
- Click
+ Intakebutton to create a new one - Choose
Microsoft 365 Message Trace (Graph API), give it a name and choose the relevant Entity - Edit the intake configuration:
- Type the
Application (client) IDin theclient idfield - Type the
Directory (tenant) IDin thetenant idfield - Type the
Valueof the client secret in theclient secretfield
- Type the
Detection section
The following section provides information for those who wish to learn more about the detection capabilities enabled by collecting this intake. It includes details about the built-in rule catalog, event categories, and ECS fields extracted from raw events. This is essential for users aiming to create custom detection rules, perform hunting activities, or pivot in the events page.
No related built-in rules was found. This message is automatically generated.