可以使用WMI创建MSMQ消息队列(PRIVATE队列)吗?
我需要在远程计算机上创建一个私有消息队列,并且我已经决定无法使用 .NET Framework 以直接的方式执行此操作。 我可以在远程计算机上创建公共消息队列,但不能创建私有消息队列。 我可以在本地创建一个消息队列(公共或私有)。
我想知道是否有人知道如何通过 WMI 访问 MSMQ。
编辑:我认为使用 MSMQ 提供程序没有任何作用。 可能需要变得棘手并使用 PSExec 登录到远程服务器并执行一些代码。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
是的,在 .NET 中创建队列很简单,但是您无法通过这种方式在远程计算机上创建专用队列。
一段时间以来,我一直在考虑向 MSMQ WMI 提供程序添加队列创建...如果您的真实产品/客户需要它,您可以联系我,我会考虑优先考虑此功能。
一切顺利,
约尔·阿农
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
有关 MSMQ 和 WMI 的博客文章位于:http://msmq.spaces.live.com/blog/cns!393534E869CE55B7! 210.entry
它说这里有一个提供程序:http://www.msmq.biz/Blog/MSMQWmiSetup.msi
它还说有一个此处参考:http://www.msmq.biz/Blog/MSMQ%20WMI%20Provider%20Objects.doc
希望这可以帮助。
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.
WMI 无法直接执行此操作。 前面的答案有一些晦涩的 WMI 提供程序,但它甚至似乎不支持队列创建。
然而,这在 .NET 中非常简单! 我不会去PSExec那么远。
MessageQueue.Create
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
我也想创建远程私有队列,但由于 .NET 不支持它,我们决定只使用远程公共队列。 如果我们根据需要设置队列的发送和接收权限,应该没问题。
一种解决方法是编写自己的 Windows 服务或 Web 服务,在队列需要驻留的同一台计算机上运行。 您可以通过套接字或通过 http 远程调用此服务,并且本地运行的代码可以创建本地专用队列。
如果您使用直接名称格式来引用队列,您可以从远程专用队列发送和接收。
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.
在文本编辑器中复制代码,将文件另存为
.vb
并执行。Copy the code in a text editor, save the file as
.vb
s and execute.