Softerra LDAP Administrator HelpShow AllHide All

DELETE Statement

The DELETE statement is used to delete LDAP entries.

Syntax

For deleting one LDAP entry

DELETE entry-DN 

For the bulk deletion of entries matching the specific criteria.

DELETE FROM base-DN [WHERE where-clause] [SCOPE search-scope] 
    [REFERRALS true|false] [PAGESIZE size-num]

DELETE keywords

KeywordDescription
DELETE Defines the type of an operation.
FROM Defines the base-DN of the entry, starting from which the search for the entries to be deleted will be run.
WHERE An optional keyword. Defines the query filter of elements to be deleted. If not specified, all entries will be deleted.
SCOPE An optional keyword. Defines the search scope of entries to be deleted. Can be ONELEVEL, SUBTREE, and BASE. Use ONELEVEL to search only the immediate children of the base-DN entry, SUBTREE to search the base-DN entry and all of its descendants, and BASE to search only the base-DN entry. If not defined, the scope value for the statement is SUBTREE.
REFERRALS An optional keyword used to define whether to delete entries in referrals. Possible values are TRUE and FALSE. If not defined, referrals are not handled.
PAGESIZE An optional keyword used to define the number of entries to be returned per one search request. For more details refer to the Paging Overview section. If this parameter is not defined, the size-num is 200.

Examples of DELETE statements

Delete entry CN=John Doe,DC=company.

DELETE "CN=John Doe,DC=company"

Delete all computers in DC=company,DC=com that has department attribute specified.

DELETE FROM "DC=company,DC=com" 
WHERE $objectClass='computer' AND $department IS NOT NULL

Delete all immediate children of OU=Groups,DC=company that has word IT in their department attribute.

DELETE FROM "OU=Groups,DC=company"
WHERE $department="*IT*"
SCOPE ONELEVEL

Delete all objects that have been created since 12.11.2010.

DELETE FROM ROOTDSE 
WHERE $whenCreated>="12.11.2010"