我们得到了一个特殊的多值属性。我们称它为 ourOwnManagedBy
,它可以包含管理当前组的用户或组(他们的 DN)。
如何检索特定用户管理的所有组的列表(借助 managedBy
和 ourOwnManagedBy
)?
例如。假设用户是 GlobalAdministrators 组的成员,而 ApplicationAdministrators 组的成员是 GlobalAdministrations。最后是 MyApplication 组,它在 ourOwnManagedBy
属性中有 ApplicationAdministrators。
用户
是GlobalAdministrators
的成员GlobalAdministrators
是ApplicationAdministrators
的成员MyApplication
在ourOwnManagedBy
中获取了
ApplicationAdministrators
我如何使用该信息来查找特定用户管理的所有群组?是否可以在自定义属性(包含用户和组的 DN)中进行某种递归检查?
更新
我试过使用这样的目录搜索过滤器:
string.Format("(ourOwnManagedBy:1.2.840.113556.1.4.1941:={0})", dn);
但我可能误解了 1.2.840.113556.1.4.1941
的作用? ( MSDN page )
最佳答案
恐怕这仅用一个 LDAP 查询是不可能完成的。您将不得不将其拆分为子查询并分别运行每个子查询,如果有很多需要迭代,这反过来会阻塞域 Controller 。
我尝试按照我描述的方式进行操作,但性能很糟糕,至少使用 .NET 的可用模块是这样。
关于c# - 查找用户管理的所有组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12054933/