I am trying to make a phone directory by pulling OU names and phone numbers from AD. When searching to see if the phone field is filled out in the current OU, and that OU has children OU that also contain a telephone field, those user accounts are being returned as well. For example:
USA
---Texas
---Florida
---New York
I'm trying to find all users that have the phone field filled out in the USA OU but it's returning users from Texas, Florida, and New York. Is there a way to limit the depth of an LDAP search?
I am using c# and my current filter to find users is just
(&(objectClass=user)(objectCategory=person))
Any help would be greatly appreciated!