summaryrefslogtreecommitdiff
path: root/utils/reset-user-passwords.sh
blob: 09bb4a5bd87b3103a8e58ef65e616da65a320f13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash

 . ./settings.sh

ldapsearch -x -h ${ldap_host} -D "${ldap_binddn}" -w "${ldap_bindpw}" -b "ou=People,${rootdn}" -LLL "(objectclass=kolabinetorgperson)" entrydn | grep ^dn: | cut -d':' -f2 | while read dn; do
    (
        echo "dn: ${dn}"
        echo "changetype: modify"
        echo "replace: userpassword"
        echo "userpassword: ${default_user_password}"
        echo ""
    ) | ldapmodify -h ${ldap_host} -D "${ldap_binddn}" -w "${ldap_bindpw}" 
done