简体   繁体   English

访问远程MSMQ计数

[英]Access Remote MSMQ Count

My machine is in Domain D1 and there are public MSMQs in a remote server in domain D2. 我的机器在域D1中,并且在域D2中的远程服务器中有公共MSMQ。 I am connected through vpn to D2, ie I can RDP the machine in D2 and access the MSMQ. 我通过vpn连接到D2,即我可以RDP D2中的计算机并访问MSMQ。

What I want is to access (Know the message count) of the MSMQ without RDPing the system. 我想要的是无需RDPing系统即可访问MSMQ(知道消息计数)。 So I build an application for this. 因此,我为此构建了一个应用程序。 I used Impersonation to impersonate the user of D2(ie used credentials of D2)but the problem is I am not able to access the "Public" MSMQ ( used Messagequeue.GetPublicQueue() ) and exceptions are thrown with message "A workgroup installation computer does not support the operation." 我使用模拟来模拟D2的用户(即使用了D2的凭据),但问题是我无法访问“公共” MSMQ(使用了Messagequeue.GetPublicQueue()),并且消息“工作组安装计算机”中引发了异常不支持该操作。” but when I used MessageQueue.GetPrivateQueue() it returned a collection of private queue. 但是当我使用MessageQueue.GetPrivateQueue()时,它返回了私有队列的集合。

I tried using MSMQManager for messageCount Path = @"Direct:OS:machine\\publicqueue"; FormatName=null; new MSMQManager.inIt(machineName, path , FormatName); 我尝试对消息计数Path = @"Direct:OS:machine\\publicqueue"; FormatName=null; new MSMQManager.inIt(machineName, path , FormatName);使用MSMQManager Path = @"Direct:OS:machine\\publicqueue"; FormatName=null; new MSMQManager.inIt(machineName, path , FormatName); Path = @"Direct:OS:machine\\publicqueue"; FormatName=null; new MSMQManager.inIt(machineName, path , FormatName); This also throws an exception either the queue is not present or not open. 队列不存在或未打开也会引发异常。 but I can check that queue is working fine. 但我可以检查队列是否正常。

Are you comfortable doing a tiny bit of programming? 您愿意进行一点点编程吗? If not, are you comfortable using PowerShell? 如果不是,您是否习惯使用PowerShell?

Either way - I would check out this post as it seems to contain the answers you are looking for. 无论哪种方式-我都会查看这篇文章,因为它似乎包含您正在寻找的答案。

Good luck, hope this helps 祝你好运,希望这会有帮助

  • Your problem might be that you are working remotely . 您的问题可能是您正在远程工作。

The method GetPublicQueuesByMachine() is indeed not available over remote access. 实际上,通过远程访问无法使用方法GetPublicQueuesByMachine()

You can see this in a feature matrix in the MSDN documentation: MessageQueue.GetPublicQueuesByMachine : 您可以在MSDN文档的功能矩阵中看到此消息: MessageQueue.GetPublicQueuesByMachine

The following table shows whether this method is available in various Workgroup modes. 下表显示了此方法在各种工作组模式下是否可用。

  Workgroup mode Available -------------- --------- Local computer No Local computer and direct format name No Remote computer No Remote computer and direct format name No 
  • Also check the access privileges of your queues. 还要检查队列的访问权限。

If I am wrong in the previous suggestion, it might be as simple as experimenting with the access rights for specific users in the network. 如果我在前面的建议中错了,那么可能就和对网络中特定用户的访问权限进行试验一样简单。

MSDN article Public and private queues states: MSDN文章“ 公共和专用队列”指出:

Default security access for public queues gives everyone permission to send messages to a public queue. 公用队列的默认安全访问权限使每个人都可以将消息发送到公用队列。 Specific permissions must be granted for read access. 必须授予特定权限才能进行读取访问。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM