Share via

Issue with Exchange Reports - Office 365 Reporting web service for MessageTrace

Kumar Sugandh 0 Reputation points
2026-03-07T12:56:53.7633333+00:00

Hello,

We are using the Exchange Reports Office 365 Reporting web service REST API for services like MessageTrace, MailDetailDlpPolicy, etc.

While all other API calls are working correctly, we are consistently encountering an issue with MessageTrace. Most of the time, the REST API call returns the error "x-rws-error: Microsoft.Exchange.Management.Tasks.ValidationException", however, it occasionally succeeds and returns data.

The API call for MessageTrace, including the filters being passed, is detailed below:

*curl --location 'https://reports.office365.com/ecp/reportingwebservice/reporting.svc/MessageTrace?%24filter=StartDate%20eq%20DateTime%272026-03-07T01%3A57%3A04.0000000Z%27%20and%20EndDate%20eq%20DateTime%272026-03-07T02%3A02%3A01.0000000Z%27' *

*--header 'Content-Type: application/json' *

*--header 'Accept: application/json' *

--header 'Authorization: Bearer <token>'

Any assistance with this issue would be greatly appreciated!

Exchange Online
Exchange Online

A cloud-based service included in Microsoft 365, delivering scalable messaging and collaboration features with simplified management and automatic updates.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Vasil Michev 126K Reputation points MVP Volunteer Moderator
    2026-03-07T13:40:24.5866667+00:00

    You should stop using the reporting web service and move to the Graph. As mentioned in this blog post, the new Graph API methods will replace the reporting web service going forward.

    If you currently use Message Trace using the Reporting Webservice, please migrate to use Message Trace using the Graph API before April 6, 2026. Message Trace and Message Trace Detail support using the Reporting Webservice will begin deprecating on April 8, 2026. 

    Using the new endpoint is fairly straightforward, but if you need additional details, I have a short guide here: https://michev.info/blog/post/7461/fetch-message-trace-data-via-the-graph-api


  2. Q&A Assist
    2026-03-07T12:57:06.9666667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    Message trace data is now better accessed by the newer Exchange Online message trace tools and cmdlets rather than the legacy Office 365 Reporting web service.

    From the current guidance:

    • The classic Get-MessageTrace cmdlet is already marked as replaced and will eventually be deprecated.
    • The recommended approach for programmatic message trace is to use the newer Exchange Online PowerShell cmdlets:
      • Get-MessageTraceV2 to search message data for the last 90 days (up to 10 days per query).
      • Get-MessageTraceDetailV2 to retrieve detailed events for a specific message.
      • Start-HistoricalSearch / Get-HistoricalSearch / Stop-HistoricalSearch for larger or older (up to 90 days) data sets.

    Given that the Office 365 Reporting web service is an older interface, the intermittent Microsoft.Exchange.Management.Tasks.ValidationException on the MessageTrace entity is consistent with the general move away from that service for message trace workloads. The supported and documented path for message trace automation is now via Exchange Online PowerShell and the modern message trace experience in the Exchange admin center / Microsoft Defender portal.

    To avoid these validation errors and align with current support, replace the Reporting Web Service MessageTrace calls with:

    • Direct PowerShell queries using Get-MessageTraceV2 for near-real-time traces within 90 days.
    • Start-HistoricalSearch followed by Get-HistoricalSearch when needing larger ranges or historical exports.

    This will use the current, supported message trace pipeline instead of the legacy Reporting web service endpoint.


    References:

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.