Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to receive the metadata of the OU's only?

Status
Not open for further replies.

thelordoftherings

Programmer
May 16, 2004
616
IL
Hello,

Let's say I have the following LDAP structure:
I have Users inside OU B and OU B is inside OU A.
OU A contains Users as well.

I am using this search control object in order to look for objects in my LDAP:

SearchControls controls = new SearchControls();
controls.setCountLimit(0);
controls.setTimeLimit(0);

I would like to get a certain property from each OU.
If I use:
controls.setSearchScope(SearchControls.SUBTREE_SCOPE);
It will search not just at the OU's A And B but at the users inside each OU as well.
If I'll use:
controls.setSearchScope(SearchControls.ONELEVEL_SCOPE);
I'll receive only the first level OU (which is A) but not OU inside the OU's first level (which is B).

Is there an option to receive results just from the OU's and not from the users inside it?
In my example I would like to receive the metadata of OU A and B only and I don't care of the metadata of the users inside OU B (or A)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top