I need to know how many users and groups are in my LDAP directory. The search looks fairly simple:
(| (objectClass=group)(objectClass=user))
The problem is that the API is very limited. I can only get a NamingEnumeration<SearchResult>
and it doesn't have a count. I didn't find any functions we can use, like the count
in SQL.
Is there any way I can get this count without having to retrieve the full query and count the results with a loop?