英文:
ldapsearch filter with dn
问题
我想要从ldapsearch中搜索提到的实体:
ldapsearch -LLL -x -H ldaps://ldapserver -E pr=1000/noprompt -b "O=XXX,C=AN" "(dn=cn=firstName lastName 1231233,ou=employee,o=xxx,c=an)"
我得到的输出是:
# pagedresults: cookie=
但是当我使用其别名搜索相同的实体时,我从命令中得到了整个对象的返回。
那么,为什么我没有从提到的命令中得到返回呢?
我想在dn字段上进行过滤,如上所述,我从别名搜索字段中得到了相同的dn。所以理论上,如果我使用正确的方式进行过滤,我应该会得到结果。
请告诉我如果我在过滤查询中有任何错误。
英文:
I wanted to search for mentioned entity from the ldapsearch:
ldapsearch -LLL -x -H ldaps://ldapserver -E pr=1000/noprompt -b "O=XXX,C=AN " "(dn=cn=firstName lastName 1231233,ou=employee,o=xxx,c=an)"
I get the output as
# pagedresults: cookie=
But when i search the same entity with its alias name, I am getting the whole object return from the command.
So, why I am not getting the return from the mentioned command.
I wanted to do the filter on the dn field from the as already mentioned and the same dn I got from the alias search field. So ideally I should get the result if I used the correct way to filter.
Please let me know if I made any mistake on the filter query.
答案1
得分: 2
你可以通过其 DN 访问条目,使用以下命令(可能是 @user207421 建议的方式):
ldapsearch -LLL -x -H ldaps://ldapserver -b "cn=firstName lastName 1231233,ou=employee,o=xxx,c=an" -s base
关键是将搜索的条目设置为适当的范围,即base。
英文:
You can access the entry by its dn using the following (probably what @user207421 suggested) :
ldapsearch -LLL -x -H ldaps://ldapserver -b "cn=firstName lastName 1231233,ou=employee,o=xxx,c=an" -s base
The key is to set the searched entry as the base with the appropriate scope, that is base.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论