[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: ldapsearch query.

Hi ,

    Thank you so much for the reply.
    With "-s sub", the search will have a deeper scope and return the
entries that match the filter and not **all** the entries under ou=local.
My requirement is to get **all** the entries that are present under the
entries that match the filter "ou=local"( these entries can be more than
    The task can be achieved in a two step process by searching for the
entries that has the ou=local in the first step and then search those
resultant entries as base(-b) for the next search with filter as
"objectclass=*", but I want to make it in a single search. so please let
me know if is this possible.

Please go through the attached file that contains the example(may be clear
this time). I have to retrieve the entries :
"ou=local, ou=payroll,  o=org.co"
"cn=John, ou=local, ou=payroll,  o=org.co"
"ou=local, ou=finance,  o=org.co"
" cn=Tom, ou=local, ou=finance,  o=org.co"
in a single search.

Thank you all for your time.


Tony Earnshaw wrote:

> Sridhar Bandi wrote:
> >       Thank you for the reply, but this query returns only
> >       the entries that has cn=local set and not all the entries
> >       under the ou=local entry which is the requirement.
> When you run ldapsearch, you can tell it how deep to search ('man
> ldapsearch'). If you put "-s sub" into the command line somewhere, it
> will do what you want. That's also called the "scope". Normally it does
> a scope 2 search (sub) by default.
> --Tonni
> --
> Tony Earnshaw
> Do not CC me or your mail will probably be rejected.
> I don't like this, either. Blame Swen and see below.
> http://www.billy.demon.nl
> Mail: billy-at-billy.demon.nl
     |                   |
     |                   |
     |                   |
   ou=payroll        ou=finance
     |                    |
  ------------       ------------
  |          |        |         |
ou=local  ou=rem    ou=rem   ou=local
  |          |        |         |
cn=John   cn=Mary   cn=Creg   cn=Tom

org:Hewlett Packard;SNSL India-ISEC
adr;quoted-printable:;;29c=3B HP=3B;bangalore;;560052;India
fn:Sridhar Bandi