'After ldapsearch need correct ldapdelete to delete same entry

In my code I did ldapsearch an object/contact and got an result and after saving the result into a file, I want to ldapdelete same entry/contact from AD.

ldapsearch -x -b CN=Computers,DC=ittest,DC=com -H ldap://ittest.com -D [email protected] -W '(CN=AcxCode#MXELD0047)'

Result:-

# extended LDIF
#
# LDAPv3
# base <CN=Computers,DC=ittest,DC=com> with scope subtree
# filter: (CN=AcxCode#MXELD0047)
# requesting: ALL
#

Wide character in print at -e line 1, <> chunk 2.
# AcxCode#MXELD0047, Computers, ittest.com
dn: CN=AcxCode\#MXELD0047,CN=Computers,DC=ittest,DC=com
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: contact
cn: AcxCode#MXELD0047
distinguishedName: CN=AcxCode\#MXELD0047,CN=Computers,DC=ittest,DC=com
instanceType: 4
info:: MXELD-0047
LDAP://OU=UXEClients,OU=201,OU=300,OU=FX,OU=MLD,DC=ittest,DC=com
Created by ittest\SKULL
name: AcxCode#MXELD0047
objectCategory: CN=Person,CN=Schema,CN=Configuration,DC=ittest,DC=com

# search result
search: 2
result: 0 Success

# numResponses: 2
# numEntries: 1

Is this correct ldapdelete command to delete above entry/contact or I am missing something?

ldapdelete -x -b CN=Computers,DC=ittest,DC=com -H ldap://ittest.com -D [email protected] -W '(objectClass:contact,CN=AcxCode#MXELD0047)'


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source