Reset passwordretrycount for all users

From Brandonhutchinson.com

(Difference between revisions)
Jump to: navigation, search
Current revision (21:20, 13 December 2007) (edit) (undo)
 
(5 intermediate revisions not shown.)
Line 1: Line 1:
-
Quick steps to reset ''passwordretrycount'' to 0 for all users in the LDAP ''passwd'' database:
+
Quick steps to reset ''passwordRetryCount'' to 0 for all users in the LDAP ''passwd'' database:
-
$ [ -f /tmp/reset_passwordretrycount.ldif ] && rm /tmp/reset_passwordretrycount.ldif
+
$ '''ldaplist passwd | grep -v '^$' | \
-
$ ldaplist passwd | grep -v '^$' | while read LINE ; do /bin/echo "$LINE\nchangetype: modify\nreplace: passwordretrycount\npasswordretrycount: 0\n" >> /tmp/reset_passwordretrycount.ldif ; done
+
> '''while read LINE ; do /bin/echo \
-
$ ldapmodify -h ''LDAP_server'' -D "cn=Directory Manager" -w ''BIND_password'' -f /tmp/reset_passwordretrycount.ldif
+
> '''"$LINE\nchangetype: modify\nreplace: passwordretrycount\npasswordretrycount: 0\n" ; done | \'''
 +
> '''ldapmodify -h ''LDAP_server'' -D "cn=Directory Manager" -w ''BIND_password'''''

Current revision

Quick steps to reset passwordRetryCount to 0 for all users in the LDAP passwd database:

$ ldaplist passwd | grep -v '^$' | \
> while read LINE ; do /bin/echo \
> "$LINE\nchangetype: modify\nreplace: passwordretrycount\npasswordretrycount: 0\n" ; done | \
> ldapmodify -h LDAP_server -D "cn=Directory Manager" -w BIND_password
Personal tools