java2db

Delete an entry from the LDAP directory using java JNDI



If we delete an entry from the LDAP server, using JNDI, the specific directory will get removed permanently from the LDAP  tree.

Basic requirements for authentication :

Delete an entry from the LDAP IP address and port of the LDAP server.

Delete an entry from the LDAP LDAP Admin DN and password.

 

 

 

Delete an entry from the LDAP

LDAP-Directory

 

Process to delete an entry from the LDAP :

First connect to the LDAP server  as an admin (must have the access to delete) .

Create user DN   to delete .

……..Example: If you want to delete  uid=112 in  ou=alzebra directory,then the  DN will be

……..uid=112,ou=alzebra ,dc=sciencedep,dc=college .

Delete an entry from the LDAP   Call the destroySubcontext  method .

Example to delete an entry from the LDAP:

Execution Result:

From the above example code :

Delete an entry from the LDAP   ldaps://10.160.2.11:1500  is the LDAP server URL   .
Delete an entry from the LDAP   cn=LDAP Administrator,dc=college,dc=org,dc=in  is the Administrator DN .
Delete an entry from the LDAP   Connection type is “simple” ,that means  it will take the plain text as password for authentication.

Delete an entry from the LDAP   uid=112,ou=alzebra,dc=mathsdep,dc=college,dc=org,dc=in  is the DN to delete .

Delete an entry from the LDAP destroySubcontext  method removes the specific entry from the LDAP tree .

Note:  The operation returns false , if the entry does not exists in the specified location.

 




Related Posts :
Solution to SSLHandshakeException (skip the certificate for Java and LDAP bind)
Delete entry from OpenLdap with java JNDI
Select an entry from LDAP using java JNDI
Update or modify LDAP entry using java JNDI
Add new entry to LDAP using java JNDI
what is directory and how to create distinguished name for LDAP
What is LDAP or Lightweight Directory Access Protocol
   [will not be published]



^ <