Friday, 19 August 2011

Viewing queues on all hub transport servers in one handy PowerShell command

I can’t take any credit for this, a college and I came up with the idea that we needed a way of viewing the queues on all of our hub transport servers in once place, opposed to having to connect to each one individually, it just so happened that he came up with the goods quicker than I did!

So what is the problem?  Using the queue viewer in EMC, it will only display the queues on the server you have selected, the same goes for the PowerShell command get-queue; you have to specify a hub transport server.

The solution, pipe the results of a get-exchangeserver cmdlet filtered to return hub transport servers into the get-queue command.
Here it is – enjoy!

get-exchangeserver | where {$_.ishubtransportserver -eq $true } | get-queue | sort messagecount –descending

Thanks Jon!

No comments:

Post a Comment