Skip to content

Commit e64c4fd

Browse files
committed
Updated doc in README
1 parent 86fa93b commit e64c4fd

File tree

1 file changed

+46
-2
lines changed

1 file changed

+46
-2
lines changed

README.md

+46-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ ANY modification!.
3232
## Usage
3333
To start with, here's the help output:
3434
```
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} ...
3636
3737
Easily perform several LDAP operations
3838
@@ -47,7 +47,7 @@ positional arguments:
4747
4848
optional arguments:
4949
-h, --help show this help message and exit
50-
50+
-v, --version Show current version
5151
```
5252
### Basic syntax
5353
The basic syntax you've to respect is the following:
@@ -69,6 +69,11 @@ In order of appearance:
6969

7070
### Performing different LDAP operations
7171

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+
7277
#### Listing attributes of an LDAP entry
7378
The `ls` action, allows you to quickly see the attributes of a particular LDAP
7479
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
123128
Note that the *double quotes* at the end of the command, **are necessary!**.
124129

125130
#### 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.
126164

127165
#### 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!. :)
128172

129173
## License
130174
This software is distributed under the GPLv3 license.

0 commit comments

Comments
 (0)