如何查询 Active Directory 对象的有效权限?
我试图以编程方式确定当前用户是否对给定的 Active Directory 对象具有某些权限(特别是在本例中,我试图确定用户是否具有其他 Exchange 用户或通讯组列表对象的“发送为”权限) )。
我已经弄清楚如何使用 ADSI 访问 ntSecurityDescriptor
属性:我可以枚举 IADsSecurityDescriptor
的 DiscretionaryACL
属性中的 ACE。但是:
- 如何根据该数据确定受托人是否明确允许或拒绝“发送为”权限?
- 当通过组成员身份间接授予权限时,我如何发现这一点?我真的必须通过(递归地)检查用户所属的所有组来自己解析有效权限吗?当然,必须有一个用于该任务的 API...
FWIW,我正在使用 ActiveDs.dll 类型库在 Delphi(即本机 Win32 代码)中进行编码,因此 .NET 特定的解决方案不会真正帮助我,除非它们的源代码为我提供了如何在本机代码中执行相同操作的线索。 PowerShell 也是如此。
在任何人开始之前:我已经了解 PR_EMS_AB_PUBLIC_DELEGATES
和 PR_EMS_AB_PUBLIC_DELEGATES_BL_O
扩展 MAPI 属性。然而,这不是我所追求的。这些属性指的是“代表发送”权限(又名委托),而不是“发送为”权限,这是完全不同的事情。
I'm trying to programmatically determine whether the current user has certain permissions on a given Active Directory object (specifically in this case, I'm trying to determine whether the user has the "Send As" permission for another Exchange user or distribution list object).
I already figured out how to access the ntSecurityDescriptor
attribute using ADSI: I can enumerate the ACEs in the IADsSecurityDescriptor
's DiscretionaryACL
property. But:
- How do I determine from that data whether the "Send As"-permission is explicitly allowed or denied for a trustee?
- How do I discover this when the permission has been granted indirectly via group membership? Do I really have to parse the effective permissions myself by (recursively) checking all groups the user is a member of? Surely there must be an API for that task...
FWIW, I'm coding in Delphi (i.e. native Win32 code) using the ActiveDs.dll typelibrary, so .NET-specific solutions won't really help me much unless their source code gives me clues to how to do the same thing in native code. The same goes for PowerShell.
Before anyone starts: I already know about the PR_EMS_AB_PUBLIC_DELEGATES
and PR_EMS_AB_PUBLIC_DELEGATES_BL_O
Extended MAPI properties. However, this is not what I'm after. These properties refer to the "Send on behalf of"-right (a.k.a. delegates), not the "Send As" permission, which is quite a different thing.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是解释的 MSDN 文章 - http ://msdn.microsoft.com/en-us/library/windows/desktop/ms675580(v=VS.85).aspx。随附的示例展示了如何调用 API。
Here's the MSDN article that explains - http://msdn.microsoft.com/en-us/library/windows/desktop/ms675580(v=VS.85).aspx. There is an attached sample that shows how to call the API.