2

I'm trying to remove two attributes from LDAP user.

Pseudo command:

ldapdelete -D "uid=username,attribute1,attribute2" -w my_pass -h localhost

How 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

Examples on GitHub

1 Answer 1

4

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
  • 1
    Thank you. I had to add also -x -Z to use simple auth and to use StartTLS.
    – kenorb
    Oct 17, 2013 at 12:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .