我可以将用户与跨不同域的组相匹配吗?
我正在尝试编写一个 LDAP 查询,它将发现用户是否是与通配符查询匹配的组的成员,并且我正在尝试使用 LDAP_MATCHING_RULE_IN_CHAIN OID 来执行此操作。我基本上遵循本页上的示例 2:
http://support.microsoft.com/kb/914828
我'我发现这种方法在域中运行良好,即如果 user1 在 group1 中并且 group1 在 group2 中,那么我可以编写一个匹配“*2”的查询,LDAP 查询将找到嵌套关系并将用户与组进行匹配。
但是,现在我被要求支持同一林中的域之间的关系。所以现在我得到了:
- user1 是域 1 中 group1 的成员
- 域 1 中 group1 是域 2 中 group2 的成员
我希望能够将 user1 与 group2 进行匹配....我不知道如何使 LDAP_MATCHING_RULE_IN_CHAIN 执行此操作:
我尝试将查询的基础设置为以下内容:
- 域 1,但这仅返回域 1 中的组
- 域 1 和域 2 的父域,但这没有返回结果。
- GC,通过查询“rootDSE”属性找到,但这只返回域 1(这是 GC 服务器)内的组
有人知道我如何才能完成这项工作吗?
I'm trying to write an LDAP query which will discover if a user is a member of a group which matches a wildcard query and I'm trying to use the LDAP_MATCHING_RULE_IN_CHAIN OID to do this. I'm basically following example 2 on this page:
http://support.microsoft.com/kb/914828
I've found that this method works well within a domain i.e. if user1 is in group1 and group1 is in group2 then I can write a query matching "*2" and the LDAP query will find the nested relationship and match the user against the group.
However, now I've been asked to support relationships between domains in the same forest. So now I've got:
- user1 is a member of group1 in domain 1
- group1 in domain 1 is a member of group2 in domain 2
And I want to be able to match user1 against group2.... I can't work out how to make LDAP_MATCHING_RULE_IN_CHAIN do this:
I've tried setting the base of the query to the following:
- Domain 1, but this just returns groups in domain 1
- The parent domain of domain 1 and domain 2, but this returns no results.
- The GC, found by querying "rootDSE" property but this just returns groups inside the domain 1 (which is the GC server)
Anyone know how I can make this work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我了解,一种方法是:
nETBIOSName
属性的crossRef
类对象。dnsRoot
和nCName
属性描述的算法。工作林 DNS 允许您加入dnsRoot
的域控制器。nCName
允许从根开始搜索。作为企业管理员组的成员,请小心执行此操作。
这是代码示例。
这只是一个概念证明,您必须完成:
使用
using(){}
表单来处置 DirectoryEntry 对象异常管理
已编辑 (2011-10-18 13:25)
您对方式的评论您可以在 System.DirectoryServices.AccountManagement 命名空间。这是一种递归解决方案。这次,我使用属于 group1(在另一个域中)的用户进行测试,该用户属于 group2(在第三个域中),并且似乎有效。
As far as I understand, one way of doing that is :
crossRef
with an attributenETBIOSName
existing.dnsRoot
andnCName
attributs. A working forest DNS allows you to join a domain controler ofdnsRoot
.nCName
allows to search from the root.Be careful to do this as a member of the enterpreise administrators group.
Here is an example of the code.
This is just a proof of concept, you have to complete with :
using
using(){}
form for disposing DirectoryEntry objectsException management
Edited (2011-10-18 13:25)
Your comment about the way you solve the problem can be found in a method given in System.DirectoryServices.AccountManagement Namespace. It's a kind of recursive solution. This time, I test with a user belonging to group1 (in an other domain) which belongs to group2 (in a third domain) and it seems to work.