Thanks for reaching out to the Microsoft Q&A forum
I appreciate your patience while I gathered some insights regarding your question on retrieving detailed Message Trace logs programmatically.
Here’s what I found based on my research:
1."What is the recommended API or method in 2025 for retrieving detailed Message Trace logs programmatically?"
Currently, the most reliable way to retrieve Message Trace data programmatically is through PowerShell using Get-MessageTraceV2 (ExchangePowerShell) | Microsoft Learn
For example:
Get-MessageTraceV2 -SenderAddress $SenderUPN -StartDate 11/13/2025 -EndDate 11/15/2025 | fl
This provides details such as Message Trace ID, Message ID, Received time, Sender and Recipient addresses, IPs, Subject, Status, and Size.
To get more granular routing details, you can use: Get-MessageTraceDetailV2 (ExchangePowerShell) | Microsoft Learn
Get-MessageTraceDetailV2 -MessageTraceId $MessageTraceID -RecipientAddress $RecipientUPN | fl
2."Is there any supported Microsoft Graph API endpoint, or should I continue using the Service Communication / Reporting Web Service or PowerShell-based methods?"
A new Microsoft Graph API endpoint for Message Trace is planned for release in December 2025, but the exact date has not yet been confirmed.
Please note that the legacy Reporting Web Service will be deprecated on March 18, 2026. If you are currently using it, we recommend migrating to the new Message Trace experience via PowerShell.
Reference: Announcing General Availability (GA) of the New Message Trace in Exchange Online | Microsoft Commun…
3."Are there any API limitations, such as history duration, throttling, or missing fields, that I should be aware of?"
For Reporting Web Service, your app will need the ReportingWebService.Read.All permission.
For more details, please refer to this article: Office 365 Reporting web service | Microsoft Learn
For PowerShell-based access, you’ll need Exchange.ManageAsApp along with appropriate Microsoft Entra roles.
Detailed steps: App-only authentication in Exchange Online PowerShell and Security & Compliance PowerShell | Mi…
4."Are there any API limitations, such as history duration, throttling, or missing fields, that I should be aware of?'
Since the API approach has not been introduced yet, I’m unable to confirm any specific limitations at this time.
However, for the Get-MessageTrace cmdlet, there are some important constraints to keep in mind:
- You can only search message data from the last 90 days.
- The date range between StartDate and EndDate cannot exceed 10 days.
- Each query returns up to 1,000 results, with a maximum of 5,000 results overall.
- Throttling applies: a maximum of 100 query requests is allowed within a 5-minute window.
5."If Microsoft is deprecating older Message Trace methods, what is the new recommended replacement?"
The recommended replacement is the new Message Trace feature, which you can access through the Exchange Admin Center or via PowerShell. As mentioned earlier, the API-based approach is expected to be introduced in the near future.
I hope this helps clarify your questions. If you have any further concerns or need additional guidance, please feel free to share.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.