0

We are using the following LDIF to remove POSIX Attributes from our LDAP Directory. This works fine, except in the case where an attribute does not exist. For e.g. it will fail if the homedirectory attribute doesn't exist. How can I make this such that the rest of attributes will be deleted even if one or more of them are not set for an entry?

dn: uid=5,ou=people,o=company.com,o=corp
changetype: modify
delete: uidnumber
-
delete: homedirectory
-
delete: objectclass
objectclass: posixAccount
-
delete: loginshell
-
delete: unixusername
-
delete: gidnumber
-
Saqib Ali
  • 428
  • 2
  • 7
  • 21

1 Answers1

0

Yes you can achieve this by using -c option flag in ldapmodify. So the command will be

ldapmodify -x  -D "bindDN" -W -f "abc.ldif" -c

The -c option states:

Continuous operation mode. Errors are reported, but ldapmodify will continue with modifications. The default is to exit after reporting an error.

Hope this helps!, Please support the answer by marking it as answered or helped if it did. Thanks!

Anirudh Malhotra
  • 1,290
  • 8
  • 11