@@ -32,7 +32,7 @@ ANY modification!.
32
32
## Usage
33
33
To start with, here's the help output:
34
34
```
35
- usage: tiny-ldap-manager.py [-h] SERVER BINDDN {ls,modify,add,delete} ...
35
+ usage: tiny-ldap-manager [-h] [-v ] SERVER BINDDN {ls,modify,add,delete} ...
36
36
37
37
Easily perform several LDAP operations
38
38
@@ -47,7 +47,7 @@ positional arguments:
47
47
48
48
optional arguments:
49
49
-h, --help show this help message and exit
50
-
50
+ -v, --version Show current version
51
51
```
52
52
### Basic syntax
53
53
The basic syntax you've to respect is the following:
@@ -69,6 +69,11 @@ In order of appearance:
69
69
70
70
### Performing different LDAP operations
71
71
72
+ #### Authentication
73
+ Take into account that, an * authenticated session* is always assumed. So you are
74
+ gonna be asked for the corresponding credentials, each time you perform an
75
+ operation!.
76
+
72
77
#### Listing attributes of an LDAP entry
73
78
The ` ls ` action, allows you to quickly see the attributes of a particular LDAP
74
79
entry. For this, you have to provide the DN of the latter. For example:
@@ -123,8 +128,47 @@ tiny-ldap-manager ldap://192.168.100.5 "cn=config" modify -M DELETE "uid=charles
123
128
Note that the * double quotes* at the end of the command, ** are necessary!** .
124
129
125
130
#### Adding entries to your LDAP
131
+ The way to add entries to an LDAP database with ` tiny-ldap-manager ` , is by
132
+ creating a CSV file using the header row (first row), to specify the attributes
133
+ for each new entry. You must ensure that you use a * semi-colon* as the CSV
134
+ delimiter!.
135
+
136
+ Besides the CSV * header row* , the rest of them, are to be used to define the
137
+ value of each corresponding attribute.
138
+
139
+ The order in which the LDAP attributes are specified in the CSV file, is not
140
+ important, as long as there is a logical correlation between the * value* assigned
141
+ to each * attribute* and the * attribute* itself!. Even then, for the sake of
142
+ clarity, it's a good idea to always put the DN in the first place!.
143
+
144
+ Now, let's see an example of a CSV file content:
145
+ ```
146
+ dn;objectClass;uid;cn;sn;givenName;displayName;mail
147
+ uid=cdarwin,ou=people,dc=scileague,dc=org;['inetOrgPerson','organizationalPerson'];cdarwin;cdarwin;Darwin;Charles;Charles Darwin;charlesdarwin@scileague.org
148
+ uid=alovelace,ou=people,dc=scileague,dc=org;inetOrgPerson;alovelace;alovelace;Lovelace;Ada;Ada Lovelace;adalovelace@scileague.org
149
+ uid=aeinstein,ou=people,dc=scileague,dc=org;inetOrgPerson;aeinstein;aeinstein;Einstein;Albert;Albert Einstein;alberteinstein@scileague.org
150
+ ```
151
+ The following is how you would import such entries:
152
+ ```
153
+ tiny-ldap-manager ldap://192.168.100.5 "cn=config" add scileague.csv
154
+ ```
155
+
156
+ As you might noticed in the CSV, the entry that belongs to * Charles Darwin* , has
157
+ a * formatted list* of * values* for the ` objectClass ` * attribute* . That's a
158
+ supported way to include more than one * value* for a given * attribute* .
159
+
160
+ As a final note about importing new LDAP entries, if one or many of them, already
161
+ exist in the LDAP database, you can be sure that they won't be imported, but
162
+ equally important, is the fact that they won't interrupt the whole process
163
+ neither. An output message is shown in each case.
126
164
127
165
#### Deleting an entry from your LDAP
166
+ You can simply remove an LDAP entry from your database, by indicating its DN,
167
+ as is shown next:
168
+ ```
169
+ tiny-ldap-manager ldap://192.168.100.5 "cn=config" delete "uid=bob,ou=people,dc=somecorp,dc=com"
170
+ ```
171
+ Poor Bob!. :)
128
172
129
173
## License
130
174
This software is distributed under the GPLv3 license.
0 commit comments