查找用户所属的组,其中成员专有名称中包含逗号

发布于 2024-12-15 10:40:23 字数 530 浏览 4 评论 0原文

我有一个非常简单的查询,我正在尝试将其作为 LDAP 查询针对 Active Directory 运行。

它是一个子树查询,如下所示: (&(objectClass=group)(member=CN=Moretti\, Stephen,OU=Users,OU=mysection,DC=mydomain,DC=local))

我已经完成了各种工作但由于 \,在成员 DN 的 CN 中我似乎无法找到关联的组。

我知道这是问题所在,因为如果我尝试使用具有“简单”CN 的用户,例如: (&(objectClass=group)(member=CN=EasyUserName,OU=Users,OU=mysection,DC =mydomain,DC=local)) 我得到了“EasyUserName”所属组的列表。

我知道在 CN 中转义逗号应该可行,但事实并非如此。我已经通过许多不同的客户端(包括 CFLDAP)尝试过此操作,但它们无法返回结果集。

困惑...有人见过类似的吗?我做错了什么吗?

I've got a really simple query that I'm trying to run against Active Directory as an LDAP query.

Its a subtree query and looks like this:
(&(objectClass=group)(member=CN=Moretti\, Stephen,OU=Users,OU=mysection,DC=mydomain,DC=local))

I've trued a variety of work arounds but because of the \, in the CN of the member DN I don't seem to be able to find the associated groups.

I know that this is the problem, because if I try this with a user with "simple" CN eg : (&(objectClass=group)(member=CN=EasyUserName,OU=Users,OU=mysection,DC=mydomain,DC=local)) I get a list of the groups "EasyUserName" is a member of.

I know that escaping the comma in the CN should work, but it isn't. I've tried this via a number of different clients including CFLDAP and they fail to return a result set.

Baffled... Anyone seen anything similar? Am I doing something wrong?

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

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

发布评论

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

评论(3

羞稚 2024-12-22 10:40:23

不是 LDAP 特定的,但我在各种系统中遇到的转义问题是编程语言可能在发送到服务器之前转义。如果是这种情况,那么转义斜杠可能会起作用。

cn=last\\, first

Not LDAP specific but something I've run into with escaping in various system is that the programming language might be escaping before sending to the server. If this is the situation then escaping the slash might work.

cn=last\\, first
宣告ˉ结束 2024-12-22 10:40:23

我也遇到过类似的情况,然后就这样逃脱了。你检查过是不是因为其他原因?您是否已验证该成员的 DN?逗号后面应该有空格吗?

您是否尝试过LDP等其他工具来查询AD?

I've been in similar situation and escaping it like that works. Have you checked that it's not because of other things? Have you verified the member's DN? Should there be a space after the comma?

Have you tried other tools like LDP to query AD?

风渺 2024-12-22 10:40:23

尝试查找用户&然后获取他们所属的组(属性是memberof)。

Try looking up the user & then get the groups they're a member of (attribute is memberof).

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