I'm trying to remove two attributes from LDAP user.
Pseudo command:
ldapdelete -D "uid=username,attribute1,attribute2" -w my_pass -h localhostHow do I do that?
Note: When searching I'm using the following working command:
ldapsearch -D "cn=my-test,ou=Services,dc=foo,dc=com" -w my_pass -h localhost -b "ou=Non-Enterprise,ou=People,dc=foo,dc=com" -s sub -x -ZZ "(uid=username)"Related:
How do I delete one attribute in LDAP with LDIF?
Sun Java System Directory Server Enterprise Edition 6.0 Administration Guide
1 Answer
ldapdelete is to remove entries, you need to use ldapmodify to delete attributes.
This command should remove attribute1 and attribute2 from the username entry:
$ ldapmodify -D "uid=..." -w ... -h ... <<%EOF%
dn: uid=username,ou=Non-Enterprise,ou=People,dc=foo,dc=com
changetype: modify
delete: attribute1
-
delete: attribute2
%EOF% 1