Rather than having to register directory users manually via the Jiglu web interface, we provide a command-line tool to traverse the directory and automatically register users matching end-user supplied rules. This is particularly useful when commissioning the system, but may be run at any time to bulk-register users.
The tool can be run from /opt/jiglu/bin/register-directory-users.sh
. When run it will read bootstrap.properties
to enable it to locate and connect to the directory using the same parameters as the Jiglu server. Other data is taken from command line switches, as follows:
-v | Run in verbose mode. |
-s | By default, all user records beneath |
-f | Specify an additional filter to include in the search. |
Send matching users a welcome email. By default, no email will be sent. | |
-register | Actually register matching users. By default, matching users are only listed in a report to the screen. |
username | The username of a Jiglu user with the System Administrator role. |
password | The password of that user. |
The usual operation is to run the tool once to generate a report of matching users that will be registered, and then to run a second time with the -register
switch to actually register the users once the matching set is confirmed as correct.
For instance, to check all user records beneath com.jiglu.ldap.userBase
that have an email address at example.com, use:
/opt/jiglu/bin/register-directory-users -f "mail=*.example.com" -register sysadmin password
and then to perform the actual registration, use:
/opt/jiglu/bin/register-directory-users -f "mail=*.example.com" -register sysadmin password
Note that if you are using Microsoft Active Directory, there is a maximum limit of 1000 records returnable in a search. This means if you run the tool with a set of parameters that matches more than 1000 users Active Directory throws an exception. Currently the only solution to this is to constrain the matches further to reduce the results below 1000 and run the tool as many times as needs to be run with filters or sub-branches to match the whole set, piece by piece.