最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

ldap - Openldap: how to get all entries which contain ou=idmap? - Stack Overflow

programmeradmin2浏览0评论

This line return all entries with sambaIdmapEntry

ldapsearch -Q -H ldaps://ldap1.blu.priv -b dc=ldap1,dc=blu,dc=priv -D cn=mailAccountReader,ou=Manager,dc=ldap1,dc=blu,dc=priv -vvv -LLL -w password "(&(objectClass=sambaIdmapEntry))"

I want a query to return all voices which has ou=idmap

I have tried this but don't work

ldapsearch -Q -H ldaps://ldap1.blu.priv -b dc=ldap1,dc=blu,dc=priv -D cn=mailAccountReader,ou=Manager,dc=ldap1,dc=blu,dc=priv -vvv -LLL -w password "(&(objectClass=sambaIdmapEntry(ou=idmap))"

This line return all entries with sambaIdmapEntry

ldapsearch -Q -H ldaps://ldap1.blu.priv -b dc=ldap1,dc=blu,dc=priv -D cn=mailAccountReader,ou=Manager,dc=ldap1,dc=blu,dc=priv -vvv -LLL -w password "(&(objectClass=sambaIdmapEntry))"

I want a query to return all voices which has ou=idmap

I have tried this but don't work

ldapsearch -Q -H ldaps://ldap1.blu.priv -b dc=ldap1,dc=blu,dc=priv -D cn=mailAccountReader,ou=Manager,dc=ldap1,dc=blu,dc=priv -vvv -LLL -w password "(&(objectClass=sambaIdmapEntry(ou=idmap))"
Share Improve this question asked Mar 14 at 17:58 elbarnaelbarna 7932 gold badges14 silver badges33 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

If you want to find all entries under one specific OU, specify that OU as the base:

ldapsearch -b ou=idmap,dc=ldap1,dc=blu,dc=priv "(objectClass=sambaIdmapEntry)"

If you want to find all entries themselves having the attribute ou: idmap, specify that as the filter:

-b dc=ldap1,dc=blu,dc=priv "(&(objectClass=sambaIdmapEntry)(ou=idmap))"

If you want to find all entries under all specific OUs anywhere in the directory (or in other words, having ou=idmap anywhere within their DN), use the OpenLDAP-specific :dn: match flag:

-b dc=ldap1,dc=blu,dc=priv "(&(objectClass=sambaIdmapEntry)(ou:dn:=idmap))"

(:dn: is not really OpenLDAP-specific, but it's an optional feature which most other LDAP implementations don't support; e.g. Active Directory does not.)

发布评论

评论列表(0)

  1. 暂无评论