There's more...

To view messages that are queued for delivery, you can use the Get-Message cmdlet. If you want to view all of the messages that are sitting in queues with a status of Retry, use the following command:

    Get-TransportService | `
    Get-Queue -Filter {Status -eq 'Retry'} | `
    Get-Message  

The Get-Message cmdlet also provides a -Filter parameter that can be used to find messages that match some specific criteria:

    Get-TransportService | Get-Message `
    -Filter {FromAddress -like '*contoso.com'}  

The previous command returns all queued messages from every server in the organization where the sender domain is contoso.com.

If you know which server the message is queued on, and you just want to view the properties of the message, you can ...

Get Microsoft Exchange Server 2016 PowerShell Cookbook - Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.