Reading all user names (object names) in my domain
Dear all
THANKS IN ADVANCE FOR RESPONSES!
New to JNDI, I'm trying to read the entire "address book" or user list/object list from a particular domain. Code I've seen tells me of displaying a single user/object's attributes!., but I need to list all users and their associated information.
I would much welcome sample code.
Thanks!
I've worked around this, using COM and JNI, and It works on my intended platform (could you guess which?). But I might want to migrate the application some day!
By domain I will assume you mean Active Directory.
If you want to return all users with an LDAP query, just issue the correct LDAP search request.
The filter would be similar to:(&(objectCategory=cn=Person,cn=your schema naming context)(samAccountType=805306368))
Ensure that you use a subtree search and use the correct search base.
If you have multiple domains, target your search against the global catalog.
refer to the post JNDI, Active Directory, Referrals and Global Catalog available at http://forum.java.sun.com/thread.jspa?threadID=603815&tstart=15
Note that for performance & security (denial of service attacks) reasons, by default, AD will only return 1000 results, so you must used paged results.
refer to the post JNDI, Active Directory, Paging and Range Retrieval available at http://forum.java.sun.com/thread.jspa?threadID=578347&tstart=0