0 XP

Message trace with Get-MessageTraceV2

What replaced Get-MessageTrace

Legacy Get-MessageTrace and Get-MessageTraceDetail began deprecating for worldwide customers on Sep 1, 2025. The replacements are Get-MessageTraceV2 and Get-MessageTraceDetailV2, which need module 3.7.0 or later. Legacy trace through the Reporting Webservice was scheduled to end Apr 8, 2026.

The portal route is the EAC: Mail flow > Message trace, at https://admin.exchange.microsoft.com/#/messagetrace. Search-UnifiedAuditLog is the audit log, not mail flow.

The limits

  • Searches the last 90 days, at most 10 days per query. A three-week window inside the last 90 days takes several queries of 10 days or less.
  • With no parameters, returns the last 48 hours.
  • Returns 1,000 results by default, 5,000 at most. -ResultSize (1 to 5000) replaces -PageSize from Get-MessageTrace; Unlimited is not allowed.
  • Throttled at 100 queries in a 5-minute running window. A script that queries every second hits it.
  • Output timestamps are in UTC.

Getting the next set

There is no pagination and no -Page parameter. When a query returns its maximum, run it again with the last record's recipient address as -StartingRecipientAddress and its Received time as -EndDate. Use MessageTraceId where you can; it is required for messages sent to more than 1,000 recipients.

Filters

  • -Status values: Delivered, Expanded, Failed, FilteredAsSpam, GettingStatus, Pending, Quarantined.
  • -SubjectFilterType values: Contains, StartsWith, EndsWith. Microsoft recommends StartsWith or EndsWith.

Get-MessageTraceDetailV2 returns the event detail of one message; it is not a way to page through results.

Working an investigation

A user says mail from a supplier never arrived three weeks ago. Check the window first: it must fall within the last 90 days. Then split it into queries of 10 days or less, filter on the sender, and read the -Status of each hit. If one query returns 5,000 rows, narrow the filter or page with -StartingRecipientAddress and -EndDate. Pause between queries in loops so the script stays under 100 queries in 5 minutes.

Knowledge check

6 questions on what you just read. Each answer shows the full explanation and its source.

Loading…