Java - Querying an LDAP Directory
yuibox 3 Comments »
(All credit to my sensei, Eric Enright)
Yesterday I spent a lot of time figuring out how to go about getting a user’s group membership information out of Active Directory, Java style. Since Active Directory is essentially a glorified LDAP server, you can connect to it through JNDI, treating it like any other database: connect to it, query it, and process your results. The below code will run over all user accounts, printing out their full LDAP DN, their email address, and their logon name.
Recent Comments