可以使用WMI创建MSMQ消息队列(PRIVATE队列)吗?

发布于 2024-07-05 21:07:36 字数 255 浏览 8 评论 0原文

我需要在远程计算机上创建一个私有消息队列,并且我已经决定无法使用 .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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

oО清风挽发oО 2024-07-12 21:07:37

是的,在 .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

妄断弥空 2024-07-12 21:07:37

有关 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.

倒数 2024-07-12 21:07:37

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

寄意 2024-07-12 21:07:37

我也想创建远程私有队列,但由于 .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.

勿忘初心 2024-07-12 21:07:37
set qinfo = CreateObject("MSMQ.MSMQQueueInfo")
qinfo.PathName = ".\Private$\TestQueue"
qinfo.Label = ".\Private$\TestQueue"
qinfo.Journal = "1"
qinfo.Create

在文本编辑器中复制代码,将文件另存为 .vb 并执行。

set qinfo = CreateObject("MSMQ.MSMQQueueInfo")
qinfo.PathName = ".\Private$\TestQueue"
qinfo.Label = ".\Private$\TestQueue"
qinfo.Journal = "1"
qinfo.Create

Copy the code in a text editor, save the file as .vbs and execute.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文