How to check mail queue in exchange 2013 powershell

To check the mail queue in Exchange 2013 using PowerShell, you can use the following commands:

  1. Get-Queue: This cmdlet retrieves a list of queues on the local Exchange server. You can use the following syntax:

    Get-Queue -Server <ServerName>

    Replace <ServerName> with the name of the Exchange server you want to check.

  2. Get-Queue -Status: This cmdlet retrieves a list of queues on the local Exchange server and displays the status of each queue. You can use the following syntax:

    Get-Queue -Status

    This will display a list of queues, including the queue name, status, and number of messages in the queue.

  3. Get-Queue -Filter: This cmdlet retrieves a list of queues that match a specific filter. You can use the following syntax:

    Get-Queue -Filter {Status -eq "Retry"}

    This will display a list of queues that are in a "Retry" status, which means that the messages in the queue are being retried for delivery.

  4. Get-Queue -Identity: This cmdlet retrieves a specific queue by its identity. You can use the following syntax:

    Get-Queue -Identity "MyQueue"

    Replace "MyQueue" with the name of the queue you want to check.

  5. Get-Message: This cmdlet retrieves a list of messages in a specific queue. You can use the following syntax:

    Get-Message -Queue <QueueName>

    Replace <QueueName> with the name of the queue you want to check.

  6. Get-Message -Filter: This cmdlet retrieves a list of messages that match a specific filter. You can use the following syntax:

    Get-Message -Filter {Status -eq "Failed"}

    This will display a list of messages that have failed delivery.

You can also use the Get-QueueStatistics cmdlet to retrieve statistics about the queues, such as the number of messages in the queue, the average age of the messages, and the number of messages that have been delivered or failed.

For example:

Get-QueueStatistics -Server <ServerName>

This will display a list of statistics for the queues on the specified server.

Note: You need to run the PowerShell console as an administrator to run these commands.