Commands › Exchange Online

Get-MessageTraceV2

Exchange Online ExchangeOnlineManagement Get-*

Trace messages as they pass through the cloud-based organization.

Quick start script

# Get-MessageTraceV2 — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-ExchangeOnline -CertificateThumbprint $thumb -AppId $appId -Organization $org

# 2. Run and inspect
Get-MessageTraceV2 | Format-List

# 3. Export for evidence / drift tracking
Get-MessageTraceV2 | Export-Clixml .\MessageTraceV2-$(Get-Date -Format yyyyMMdd).xml

Syntax

Get-MessageTraceV2
 [[-EndDate] <System.DateTime>]
 [[-FromIP] <String>]
 [[-MessageId] <MultiValuedProperty>]
 [[-MessageTraceId] <System.Guid>]
 [[-RecipientAddress] <MultiValuedProperty>]
 [[-ResultSize] <Int32>]
 [[-SenderAddress] <MultiValuedProperty>]
 [[-StartDate] <System.DateTime>]
 [[-StartingRecipientAddress] <String>]
 [[-Status] <MultiValuedProperty>]
 [[-SubjectFilterType] <String>]
 [[-Subject] <String>]
 [[-ToIP] <String>]
 [<CommonParameters>]

Parameters (13)

ParameterTypeRequiredWhat it controls
-EndDate DateTime The EndDate parameter specifies the end date of the date range.
-FromIP String The FromIP parameter filters the results by the source IP address. For incoming messages, the value of FromIP is the public IP address of the SMTP email server that sent the message.
-MessageId MultiValuedProperty The MessageId parameter filters the results by the Message-ID header field of the message. This value is also known as the Client ID. The format of the Message-ID depends on the messaging server that sent the...
-MessageTraceId Guid The MessageTraceId parameter filters the results by the message trace ID value of the message. This GUID value is generated for every message that's processed by the system (for example, c20e0f7a-f06b-41df-fe33-08d9da155ac1).
-RecipientAddress MultiValuedProperty The RecipientAddress parameter filters the results by the recipient's email address. You can specify multiple values separated by commas.
-ResultSize Int32 The ResultSize parameter specifies the maximum number of results to return. A valid value is from 1 to 5000. The default value is 1000.
-SenderAddress MultiValuedProperty The SenderAddress parameter filters the results by the sender's email address. You can specify multiple values separated by commas.
-StartDate DateTime The StartDate parameter specifies the start date of the date range.
-StartingRecipientAddress String The StartingRecipientAddress parameter is used with the EndDate parameter to query subsequent data for partial results while avoiding duplication. Query subsequent data by taking the **Recipient address** and...
-Status MultiValuedProperty The Status parameter filters the results by the delivery status of the message. Valid values are:
-Subject String The Subject parameter filters the results by the subject of the message. If the value contains spaces, enclose the value in quotation marks (").
-SubjectFilterType String The SubjectFilterType parameter specifies how the value of the Subject parameter is evaluated. Valid values are:
-ToIP String The ToIP parameter filters the results by the destination IP address. For outgoing messages, the value of ToIP is the public IP address in the resolved MX record for the destination domain. For incoming messages to...

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.