StampedeXV
StampedeXV

Reputation: 2805

Reading and/or Filtering on MSMQ name using WMI

I am currently trying to read MSMQ information on a remote machine.

The main difficulty I experience is getting the name of the queue. The names of the queues are pretty long, some more than 64 characters.

Using WMI the names always get truncated to 64 characters, which results for me in queuenames I can't differentiate (similar prefix for first 64 characters).

I tried using .NET 3.5 SP1 and WMI Multi Query Tool and no differences.

Not only couldn't I read the name, providing the suffix that would make the difference to the WMI query as WHERE didn't help also.

Any hints how to make this work?

There is a very old entry in MS support DB which could be the explanation for this behavior. Although already there (2004) it is said that it might be fixed in VS 2005. Either it has never been fixed, or maybe there something different wrong.

Upvotes: 1

Views: 575

Answers (2)

Jens H
Jens H

Reputation: 4632

I do not think that you have a chance for getting the real long-length names using WMI.

John Breakwell has blogged about it: How long MSMQ queue names are displayed ... or not

Instead the limit is in how queue names are stored in Active Directory. [...] For public queues, though, only the first 64 characters will fit in the field used to store the name in Active Directory and the remainder of the name gets stored in another field (mSMQQueueNameExt).

Upvotes: 1

Marcel N.
Marcel N.

Reputation: 13976

I suggest you try MessageQueue.GetPublicQueuesByMachine and MessageQueue.GetPrivateQueuesByMachine.

This should get you covered for both types of queues (of course, no system queues, but those are well known).

Upvotes: 1

Related Questions