MSMQ from the plumber's mate - MSMQ and Powershell #1
“Powershell is looking to be a really great scripting language and ideal for filling the void of scripts available for manipulating MSMQ.
Over the next few weeks I plan to generate some simple scripts that will perform some of the basic, and not so basic, administrative and troubleshooting tasks you need to do from time to time. There are no cmdlets written for MSMQ just yet so we will be calling into COM and System.Messaging.
Powershell reference links:
- Windows PowerShell Team blog
- Windows PowerShell ScriptCenter
- Windows PowerShell Concepts
- Windows PowerShell Cmdlets
Today's sample will be look at the active queues on a machine.
Note - "Active" means any queue containing messages or being held open by an application.…”
I’ve been using MSMQ for years and am pretty darn happy with it.
It’s nice to it get some PowerShell attention…
Hi Greg, hopefully I'll be able to put together some useful samples for people to use over time.
ReplyDeleteDo you have any suggestions for admin tasks in MSMQ that would benefit from scripting?
Cheers
John
First of all, thanks for the comment, for taking the time to original post and for the quest for feedback...
ReplyDeleteThe first MSMQ admin throughts that come to mind are;
a) Exists - Does a queue exist or not
b) Message Count
c) Clearing a queue
We use Private queues, and besides the known Create/Delete/Set/Get issues (which have to be done on the machine on which the private queues are) I've used the COM API to do the above things (well except clearing...). I think having these three things available via PowerShell would be pretty cool...
If I were using Public Queues (it's a long story) then I'd probably want Create/Delete/Get/Set as well.... :)
Hope this helps and thank you again John.