Article

akoska's picture
article
Reads:

2435

Score:
0
0
 
Comments:

0

Counting Users per Container

Author Info

28 March 2007 - 2:03am
Submitted by: akoska

(View Disclaimer)

Problem

A Forum reader recently asked:

"I need to know how many users I have per container, so I found the DSI Flags to get information about one object. Is an SDK available to make a Java program that can be invoked via scripting to get that info?"

And here's the reply from Akos Szechy ...

Solution

No ideas about Java, but if you can do an LDAP query (which should work from Java) you can ask for the operational attributes with a "+" sign. You will find a subordinate count there, like this:

ldapsearch -h host -p 389 -x -D cn=admin,o=services -w password -s base -b
o=services +

# services
dn: o=services
modifiersName: cn=ADMIN,o=SERVICES
GUID:: QGDWZHKo2gGAqa4BAgAAAA==
usedBy: #0#
revision: 20
subschemaSubentry: cn=schema
federationBoundary: t=CPL-ASZECHY-LINUXTREE
structuralObjectClass: Organization
createTimestamp: 20060228155343Z
modifyTimestamp: 20061208114232Z
subordinateCount: 36
entryFlags: 4
localEntryID: 32781


Disclaimer: As with everything else at Cool Solutions, this content is definitely not supported by Novell (so don't even think of calling Support if you try something and it blows up).

It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.




User Comments

© 2012 Novell