tags:

views:

2034

answers:

5

I need to create a PRIVATE message queue on a remote machine and I have resolved to fact that I can't do this with the .NET Framework in a straight forward manner. I can create a public message queue on a remote machine, but not a PRIVATE one. I can create a message queue (public or private) locally.

I am wondering if anyone knows how to access MSMQ through WMI.

Edit: I don't see anything to do it with using the MSMQ Provider. May have to get tricky and use PSExec to log onto a remote server and execute some code.

A: 

A blog post about MSMQ and WMI is here: http://msmq.spaces.live.com/blog/cns!393534E869CE55B7!210.entry

It says there is a provider here: http://www.msmq.biz/Blog/MSMQWmiSetup.msi

It also says there is a reference here: http://www.msmq.biz/Blog/MSMQ%20WMI%20Provider%20Objects.doc

Hope this helps.

I saw this one. I didn't know if that meant the provider had to be installed on the remote machine or not.
ferventcoder
The provider doesn't actually give a method to install a private queue anywhere, and not on a remote server.
ferventcoder
A: 

WMI can't do this out-of-box. The previous answer has some obsucre WMI provider, but it doesn't even seem to support Queue creation.

This is very simple in .NET however! I wouldn't go so far as PSExec. MessageQueue.Create

TheSoftwareJedi
Sorry man. All documentation and subsequent integration tests prove you cannot use that to create a PRIVATE message queue remotely.
ferventcoder
+1  A: 

Yes, queue creation is simple in .NET, however you cannot create a private queue on a remote machine this way. I have been thinking about adding queue creation to the MSMQ WMI provider for some time... If you need it for a real product / customer, you can contact me and I will consider giving this feature a priority. All the best, Yoel Arnon

Hmmmm... we would like to be able to where I work. It would help with our automated deployment process tremendously.
ferventcoder
What would it take to have this feature added???
ferventcoder
A: 

set qinfo = CreateObject("MSMQ.MSMQQueueInfo")

qinfo.PathName = ".\Private$\TestQueue"

qinfo.Label = ".\Private$\TestQueue"

qinfo.Journal = "1"

qinfo.Create

Copy the code in a notepad and save the file as .vbs and execute.

Remote please... not local creation
ferventcoder
A: 

I was wanting to create remote private queues also, but since .NET doesn't support it, we decided we will just use remote public queues instead. If we set Send and Receive permissions on the queues as desired, this should be fine.

One idea for a work around would be to write your own Windows service or web service that runs on the same machine where the queue needs to reside. You could call this service remotely through a socket or over http, and your locally-running code could create the local private queue.

If you use the direct name format to reference the queue, you can Send and Receive from a remote private queue.

Brian Garner