Exchange 2013 Powershell Script: Get System Wide Message Queue Status

Ran into a case where we had some delivery issues to our O365 hybrid tenant, and realized I’d never figured out a good way to take a look at all of the queues at once, and lets face it, the Exchange Toolbox Queue Viewer tool is just…sad at this point. I mean it works, but I want to know what the entire environment is doing at a glance and what our message velocity looks like. This is where the following quick script comes into play.

It’s designed to be run out of an already-connected Exchange 2013 powershell prompt, so connect using your usual method or go take a look at Chris Lehr’s blog for an awesome tool to manage your connectivity needs.

When you run it, you’ll get a screen that constantly refreshes (so you can toss it into 1 window/corner of your monitor and just let it run) and it will look similar to this:

get-messagequeuestatus_img0001

It’s pretty simple and straight forward at this time. I have it saved as “get-messagequeuestatus.ps1” in my network script repository for use from any machine.

while($true)
{
    cls
    get-date
    Get-ExchangeServer | Get-Queue | where {$_.MessageCount -gt 0} | sort MessageCount -Descending | ft -a
    sleep 10
}

I may make some enhancements in the future for color coding, requesting a certain refresh rate, etc. but for now, it’s quick and dirty and works.

Advertisements
This entry was posted in Exchange 2013, Management, Monitoring, O365, Powershell, Uncategorized and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s