TDS/SDS Blogs

So....just how many entries is under that LDAP Branch??

How to Get OU Entry Counts (numSubordinates)

User Rating: 0 / 5

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive
 

 

I have seen a couple of tools that shows the number of entries (or typically users or objects) under a LDAP branch (node).  Working with a colleague who is helping to improve our LDAP Browser, we wanted to add that "nice to know" feature to the tree.  So that is where "numSubordinates" comes in to play.

The ldap search has a great number of parameter to get data about the structure and schema and it's contents.  Here I want to quickly show the power of that one little parm.  Without it, we would have to dump the entire tree of objects and do some type of scripting to read and count each one.  Fortunately, the numSubordinate will do that job for us.  See below:

 

From Search Command:

zflexldap: # idsldapsearch -D cn=root -w ? -h localhost -p 53889 -b "ou=members,ou=megachurch,o=church,dc=zflexsoftware,dc=com" -s base "objectclass=*" numSubordinates

Results:

ou=members,ou=megachurch,o=church,dc=zflexsoftware,dc=com

numSubordinates=12655

From Search Command (megachurch OU branch difference):

zflexldap:# idsldapsearch -D cn=root -w ? -h localhost -p 53889 -b "ou=megachurch,o=church,dc=zflexsoftware,dc=com" -s base "objectclass=*" numSubordinates

Results:

ou=megachurch,o=church,dc=zflexsoftware,dc=com

numSubordinates=2

From Search Command (staff OU branch):

zflexldap: # idsldapsearch -D cn=root -w ? -h localhost -p 53889 -b "ou=staff,ou=megachurch,o=church,dc=zflexsoftware,dc=com" -s base "objectclass=*" numSubordinates

ou=staff,ou=megachurch,o=church,dc=zflexsoftware,dc=com

numSubordinates=3

Visual example:

 

There are other "operational" attributes which can be displayed with using "(*)" "+" symbols at the end of the ldapsearch command.  We go into more details in our white paper on the numSubordinates parameter.  You can download it here.

 

About zFlex Software

zFlex Software have over of 25 years experience working with the IT field.  Over 15 years working directly with IBM products and projects in Enterprise System Environments.  We focus on IBM product installation, Infrastructure Setup and Solution Design in the Mainframe (z/OS), Linux, Solaris and Window platforms.   Knowledge of these various platforms makes our consulting very flexible for Integration tasks around these various platforms, enabling zFlex to meet your business needs.

© 2016 zFlex Software,LLC. All Rights Reserved. Designed By zFlex Software

Search