I need to implement a groupware for my
organisation. In order to achieve this, I need to test each user
login, and make some interaction tests, espacially for free/busy
features of the calendar.
The authencation is against an LDAP
server.
I need to copy the LDAP server and
batch modify the passwords to be all the same in my test environment.
In order to achieve this, I need to
list all “dn” and modify the “userPassword” value.
This is done in two steps:
ldapsearch -w 'admin-password' \
-x -D 'cn=admin,dc=rktmb,dc=org' \
-b 'ou=Users,dc=rktmb,dc=org' \
-s one \
-H ldap://localhost dn
To list the users
ldapsearch -w 'admin-password' \
-x -D 'cn=admin,dc=rktmb,dc=org' \
-b 'ou=Users,dc=rktmb,dc=org' \
-s one \
-H ldap://localhost dn \
| awk '/^dn: /{print $0"\nchangetype: modify
\nreplace: userPassword
\nuserPassword:: e3NoYX11MWRucUpaQ\n";}' \
> modified.ldif
To write it to an output file.
ldapmodify -c -w 'admin-password' \
-x -D "cn=admin,dc=rktmb,dc=org" \
-H ldap://localhost \
-f modified.ldif -S modified.log
To make the changes.