Link to home
Start Free TrialLog in
Avatar of maloriopolium
maloriopolium

asked on

LDAP query

Hi,

I was wondering how to formulate an ldap query that would return all users and their manager's phone number attribute.
Currently I have the Filter set as (objectclass=user) which just returns every user in the organization.

Each user has an attribute "manager" which has their manager's Distinguished Name eg: CN=Manager's Name,OU=Staff,OU=Users,OU=CompanyName,DC=XXX,DC=local

Each user also has an attribute "homePhone" which has the phone number

So how do I say give me the user + query the user's manager and only give me the managers homePhone attribute?

Thanks.
SOLUTION
Avatar of Mike Kline
Mike Kline
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of maloriopolium
maloriopolium

ASKER

Hi mkline71.

Thanks for your reply. I forgot to add that I am trying to do this programmatically in .NET. So based on what you have said, would I need to do another sub query? So basically, I iterate through each user, and for each user, I do another ldap query filtering on the manager's DN and then get back the homePhone attribute?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks PaciB. Yes interrogating the Dictionary object makes more sense for efficiency.