Created
July 14, 2017 12:52
-
-
Save zealot128/327a8fcafa2cb05ffc244c1cfbd52953 to your computer and use it in GitHub Desktop.
Change LDAP/Samba account information from command line
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use ldapmodify and copy carefully | |
# 1. Unblock user - set expiration to never: | |
$ ldapmodify -H 'ldaps://pdc.mycompany.com:636' -D 'cn=Administrator,cn=Users,dc=pdc,dc=pludoni,dc=com' -x -W | |
Enter LDAP Password: | |
dn: CN=Firstname Lastname,CN=Users,DC=pdc,DC=pludoni,DC=com | |
changetype: modify | |
replace: accountExpires | |
accountExpires: 9223372036854775807 | |
<Ctrl+D> | |
# 2. Block user = Expire account: | |
$ ldapmodify -H 'ldaps://pdc.mycompany.com:636' -D 'cn=Administrator,cn=Users,dc=pdc,dc=pludoni,dc=com' -x -W | |
Enter LDAP Password: | |
dn: CN=Firstname Lastname,CN=Users,DC=pdc,DC=pludoni,DC=com | |
changetype: modify | |
replace: accountExpires | |
accountExpires: 131303772000000000 | |
<Ctrl+D> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment