Commands › Exchange Online

Get-Message

Exchange Online ExchangeOnlineManagement Get-*

View the details of one or more messages in queues on Mailbox servers or Edge Transport servers.

Quick start script

# Get-Message — 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-Message | Format-List

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

Syntax — 3 parameter sets

Filter

Get-Message [-Filter <String>]
 [-BookmarkIndex <Int32>]
 [-BookmarkObject <ExtensibleMessageInfo>]
 [-IncludeBookmark <Boolean>]
 [-IncludeComponentLatencyInfo]
 [-IncludeRecipientInfo]
 [-ResultSize <Unlimited>]
 [-ReturnPageInfo <Boolean>]
 [-SearchForward <Boolean>]
 [-Server <ServerIdParameter>]
 [-SortOrder <QueueViewerSortOrderEntry[]>]
 [<CommonParameters>]

Identity

Get-Message [[-Identity] <MessageIdentity>]
 [-BookmarkIndex <Int32>]
 [-BookmarkObject <ExtensibleMessageInfo>]
 [-IncludeBookmark <Boolean>]
 [-IncludeComponentLatencyInfo]
 [-IncludeRecipientInfo]
 [-ResultSize <Unlimited>]
 [-ReturnPageInfo <Boolean>]
 [-SearchForward <Boolean>]
 [-SortOrder <QueueViewerSortOrderEntry[]>]
 [<CommonParameters>]

Queue

Get-Message [-Queue <QueueIdentity>]
 [-BookmarkIndex <Int32>]
 [-BookmarkObject <ExtensibleMessageInfo>]
 [-IncludeBookmark <Boolean>]
 [-IncludeComponentLatencyInfo]
 [-IncludeRecipientInfo]
 [-ResultSize <Unlimited>]
 [-ReturnPageInfo <Boolean>]
 [-SearchForward <Boolean>]
 [-SortOrder <QueueViewerSortOrderEntry[]>]
 [<CommonParameters>]

Parameters (13)

ParameterTypeRequiredWhat it controls
-Identity MessageIdentity The Identity parameter specifies the message. Valid input for this parameter uses the syntax Server\\Queue\\MessageInteger or Queue\\MessageInteger or MessageInteger, for example, Mailbox01\\contoso.com\\5 or 10. For...
-BookmarkIndex Int32 The BookmarkIndex parameter specifies the position in the result set where the displayed results start. The value of this parameter is a 1-based index in the total result set. The BookmarkIndex parameter can't be...
-BookmarkObject ExtensibleMessageInfo The BookmarkObject parameter specifies the object in the result set where the displayed results start. The BookmarkObject parameter can't be used with the BookmarkIndex parameter.
-Filter String The Filter parameter specifies one or more messages by using OPATH filter syntax. The OPATH filter includes a message property name followed by a comparison operator and value (for example, `"FromAddress -like...
-IncludeBookmark Boolean The IncludeBookmark parameter specifies whether to include the bookmark object when the query results are displayed. The IncludeBookmark parameter is valid when it's used with the BookmarkObject or BookmarkIndex...
-IncludeComponentLatencyInfo SwitchParameter The IncludeComponentLatencyInfo switch specifies whether the information about component latency is included in the message properties. You don't need to specify a value with this switch.
-IncludeRecipientInfo SwitchParameter The IncludeRecipientInfo switch specifies whether to display the message recipients in the Recipients field. You don't need to specify a value with this switch.
-Queue QueueIdentity The Queue parameter specifies the identity of the queue that contains the messages that you want to display. Valid input for this parameter uses the syntax `<Server>\<Queue>` or `<Queue>`, for example,...
-ResultSize Unlimited The ResultSize parameter specifies the maximum number of results to return. If you want to return all requests that match the query, use unlimited for the value of this parameter. The default value is 1000.
-ReturnPageInfo Boolean The ReturnPageInfo parameter is a hidden parameter. Use it to return information about the total number of results and the index of the first object of the current page. The default value is $false.
-SearchForward Boolean The SearchForward parameter specifies whether to search forward or backward in the result set. The default value is $true. This value causes the result page to be calculated forward from either the start of the...
-Server ServerIdParameter The Server parameter specifies the Exchange server where you want to run this command. You can use any value that uniquely identifies the server. For example:
-SortOrder QueueViewerSortOrderEntry[] The SortOrder parameter specifies an array of message properties used to control the sort order of the result set. Separate each property by using a comma. Prepend a plus sign (+) symbol to the beginning of the...

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