Once the files are checked out, just type ant and wait until the distribution jar is built in the dist directory. Now you can check out the source files from Apache Directory sandbox Subversion repository.
If you want to build the library on your own, you will need:Īfter you download and install Ant, drop Ivy's jar (ivy-1.4.1.jar) into your ANT_HOME/lib directory. Drop it into your GROOVY_HOME/lib directory and you’re ready to write your first script.
After downloading and expanding the zip file you need to look for groovy-ldap.jar in the dist directory. The simplest way is to get the binaries from the Groovy LDAP download page. So with the exception of the method taking the closure, others can be also used in Java programs. The only Groovy dependency is a reference to a Closure class, which is used as a parameter in a couple of search methods. Groovy LDAP is written in Java, not Groovy. It defines a set of methods to perform basic LDAP operations: create, modify, delete, compare, search. It actually reminds me of the time when Netscape LDAP API was widely used. Under the hood, JNDI is used to perform LDAP queries, but fortunately Groovy LDAP hides it and lets you use a bunch of useful methods and objects, instead. As such, the only two dependencies of Groovy LDAP are: Its goal was to create minimalistic LDAP API for Groovy, with metaphors understood by the LDAP community (e.g. Groovy LDAP is a small library started by Stefan Zoerner from the Apache Directory project. For more information please read Apache Directory introductory article. Each directory entry has a unique identifier named DN (Distinguished Name). These attributes are defined in the LDAP schema. Every directory entry consists of a set of attributes (name/value pairs). The tree usually reflects political, geographical and/or organizational boundaries.
Organized as a tree of directory entries. LDAP 101: LDAP stands for Lightweight Directory Access Protocol. What is this LDAP thing you're talking about? But the examples can easily be adjusted to fit another directory's Group membership is often stored in group entries only, while in Active Directory it is stored inīoth group and member object. In other directory solutions for instance, They use vendor specific structure and schema elements. Please note, that the examples in this article work only with Microsoft Active Directory, because If your directory contains circular group relations, the script has to be further adjusted. LDAP ldap = LDAP.newInstance("ldap://:389/dc=mycompany,dc=com")
Ldap.eachEntry ('&(objectClass=person)(memberOf=cn=mygroup') )") LDAP.newInstance('ldap://:389/dc=mycompany,dc=com')Īfter reading through the sample scripts, I already had the main part: I downloaded the jar, dropped it into my GROOVY_HOME/lib directory and started to write the script: Groovy LDAP was beautifully simple and had no external dependencies.
But after looking at it and seeing how much configuration has to be done, I searched for some alternatives. Having 15 minutes means you need to get it right from the first run. Given the deadline, I had no chance to get it done in time. Print all members of the group within Active Directory, including members of the nested groups.