summaryrefslogtreecommitdiff
path: root/utils/reset-user-passwords.sh
diff options
context:
space:
mode:
Diffstat (limited to 'utils/reset-user-passwords.sh')
-rwxr-xr-xutils/reset-user-passwords.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/utils/reset-user-passwords.sh b/utils/reset-user-passwords.sh
new file mode 100755
index 0000000..09bb4a5
--- /dev/null
+++ b/utils/reset-user-passwords.sh
@@ -0,0 +1,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
+