具有 MemberOf 属性的 LDAP DirectorySearcher,适用于属于 ad_group1 或 ad_group2(任何组或两个组)成员的用户

发布于 2024-12-22 14:00:50 字数 297 浏览 0 评论 0原文

当前用于检查用户是否是 ad_group1 成员的搜索过滤器

&(memberOf=CN=ad_group1,OU=my_ou,DC=abc,DC=com) 

需要配置搜索过滤器以检查用户是否是 ad_group1ad_group2 的成员> 或两个组。

目前,搜索过滤器对于 ad_group1 组的成员正常工作。

如何扩展搜索过滤器以包含其他组的条件?

Current search filter for checking if the user is a member of ad_group1

&(memberOf=CN=ad_group1,OU=my_ou,DC=abc,DC=com) 

Need to configure the search filter to check if the user is member of ad_group1 or ad_group2 or both the groups.

Currently the search filter is working properly for the members of group ad_group1 .

How to expand the search filter to include the condition for the other group?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

魂ガ小子 2024-12-29 14:00:50

尝试如下操作:

&(|(memberOf=CN=ad_group1,OU=my_ou,DC=abc,DC=com)(memberOf=CN=ad_group2,OU=my_ou,DC=abc,DC=com))

| 运算符是 LDAP 过滤器中的逻辑 OR

有关更多示例和说明,请参阅此处的本文 LDAP 过滤器语法。

Try something like this:

&(|(memberOf=CN=ad_group1,OU=my_ou,DC=abc,DC=com)(memberOf=CN=ad_group2,OU=my_ou,DC=abc,DC=com))

The | operator is the logical OR in LDAP filters.

See this article here for more examples and explanations of the LDAP filter syntax.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文