如何以编程方式读取 MSMQ 队列上的权限?
有大量关于使用 .net System.Messaging.MessageQueue SetPermissions 方法以编程方式设置 MSMQ 权限的在线建议。但我找不到任何 system.messaging 属性,可以让我读取当前在现有队列上配置的权限。
我正在尝试编写一个 powershell 审核脚本来盘点数十台机器的配置,如果我无法获得队列的配置权限,它几乎完全没有用。
我愿意接受有关命令行选项的建议,但没有找到 stackoverflow 中提到的任何内容。 Yoel 的 MSMQ WMI 提供程序没有公开必要的信息,据我所知,MSMQ 没有提供任何命令行来获取这些信息。
不敢相信这是没有人解决的问题。 Microsoft 的另一款企业产品缺少基本的安全功能(验证)。
使用 powershell 进行审计,更喜欢内置或 .net 框架解决方案,但如果需要,可以通过任何必要的方式 (CLI) 获取信息。
There are tons of online suggestions for setting MSMQ permissions programmatically using .net System.Messaging.MessageQueue SetPermissions method. But I cannot find any system.messaging property that lets me read the permissions currently configured on existing queues.
I'm trying to write a powershell audit script to take stock of dozens of machines configurations, and its almost entirely useless if I can't get the configured permissions for the queues.
I'm open to suggestions for command line options, didn't find anything mentioned in stackoverflow. Yoel's MSMQ WMI provider doesn't expose the necessary info, and as far as I can tell there is no command line provided with MSMQ that gets you this.
Can't believe this is something no one has addressed. Another enterprise product by Microsoft that's missing a fundamental security feature (verification).
Using powershell for the audit, would prefer built in or .net framework solutions, but getting the info by any means necessary (CLI) if need be.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可能会在使用 P/Invoke 调用 MQGetQueueSecurity 时遇到困难。 IIRC COM 接口也不支持读取队列权限。
You may be stuck using P/Invoke to call MQGetQueueSecurity. IIRC the COM interface doesn't have support for reading queue permissions either.
我遇到了同样的问题,并采纳了此处建议的一些建议。我制作了一个小型 C# 项目,它使用 p/invoke 来获取给定队列的用户权限。
请随意使用或贡献它:
https://github.com/jlevitt/MSMQSecurity
I had the same problem and took some of the advice that has been suggested here. I made a small c# project that uses p/invoke to get the user's permissions for a given queue.
Please feel free to use or contribute to it:
https://github.com/jlevitt/MSMQSecurity