[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
one).
    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.

Regards,
Bandi.



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
           o=org.co
             |
             |
     ---------------------
     |                   |
     |                   |
     |                   |
   ou=payroll        ou=finance
     |                    |
  ------------       ------------
  |          |        |         |
ou=local  ou=rem    ou=rem   ou=local
  |          |        |         |
cn=John   cn=Mary   cn=Creg   cn=Tom


begin:vcard 
n:Bandi;Sridhar
tel;home:91-80-5266263
tel;work:91-80-2052886
x-mozilla-html:FALSE
org:Hewlett Packard;SNSL India-ISEC
version:2.1
email;internet:bandis@india.hp.com
adr;quoted-printable:;;29c=3B HP=3B;bangalore;;560052;India
x-mozilla-cpt:;26624
fn:Sridhar Bandi
end:vcard