Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

How can I retrieve the names of all of the private MSMQ queues on the local machine, without using System.Messaging.MessageQueue.GetPrivateQueuesByMachine(".")? I'm using PowerShell so any solution using COM, WMI, or .NET is acceptable, although the latter is preferable.

Note that this StackOverflow question has a solution that returns all of the queue objects. I don't want the objects (it's too slow and a little flakey when there are lots of queues), I just want their names.

share|improve this question

1 Answer 1

In Powershell everything is an object. You can choose to list certain properties by using the select command which effectively discards the objects.

share|improve this answer
    
Thanks, @uSlackr. I'm trying to avoid instantiating all the objects if I can help it, because it's very slow. Ideally, I want to instantiate only those queues that have a name matching a certain pattern. Since there is no API for that (that I'm aware of) I want to get the list of names, filter that, then retrieve each queue individually. –  Damian Powell Jun 15 '12 at 14:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.