Hi,

your filter is correct, but is not the right filter to fetch your
information.
The location information about the object has to be expressend in the
"search base" and not in the filter. If you know the container, you can
narrow the search by specifying this in the "base" parameter.

The attribute values in the filter relate to the attributes values
INSIDE the object itself.

You can find your object with:

ldapsearch -D <bind-dn> -w <pw> -b "ou=1234,o=abdc" "(cn=lookhere)"

you can find the object even with:

ldapsearch -D <bind-dn> -w <pw> -b "o=abdc" "(cn=lookhere)"


if you specify (&(ou=1234)(cn=lookhere)) you are looking for all objects
with cn=lookhere AND containing an "ou attribute" whose value is "1234".
You object seemigly does not contain this attribute with this value and
will not be fetched.

Best regards
Giovanni


skalyanasundaram wrote:
> Hello everyone,
>   I am new to this place.
>   I have a problem with the search filter for the ldapsearch query...
>  
> i have a architecture like
>  
> o=abcd
>  |
>  |-- ou=1234
>  |   |
>  |   |--cn=lookhere
>  |
>  |-- cn=service
>  .
>  .
> i am trying to look for "cn=lookhere"
>  ldapsearch -D cn=admin,o=abcd -b o=abcd -w pwd "cn=lookhere"
>    It works fine it search and gives
>  ldapsearch -D cn=admin,o=abcd -b o=abcd -w pwd
> "(&(cn=lookhere)(ou=1234))"
>  ldapsearch -D cn=admin,o=abcd -b o=abcd -w pwd
> "(&(ou=1234)(cn=lookhere))"
>  does not show any "Bad filter" error but it does not show any result also
>  
>  i have gone through rfc 1558,
>  according to that "<attr> is a string representing an AttributeType"
>                     <value> is a string representing an AttributeValue"
>  
>  
> this "lookhere" object does not have any attribute called "ou" is it the
> mistake?
> so my case is that there is object inside many sub containers.
> i want to minimize the search. I know only the basedn and two three
> sorrounded container
> of the looking object.. may be between o=abcd and cn=lookhere there are n
> number of
> containers....
> so how do i find?
> I found in net, few examples same like this?
>  
> plz somebody help me.....
>  
> advance thanks,
>   -"kalyan"
> 
> ---
> You are currently subscribed to [email protected] as: [EMAIL PROTECTED]
> To unsubscribe send email to [EMAIL PROTECTED] with the word UNSUBSCRIBE as 
> the SUBJECT of the message.
> 


---
You are currently subscribed to [email protected] as: [EMAIL PROTECTED]
To unsubscribe send email to [EMAIL PROTECTED] with the word UNSUBSCRIBE as the 
SUBJECT of the message.

Reply via email to