Novell is now a part of Micro Focus

Deleting Users from eDirectory with an LDIF File

Articles and Tips: qna

01 Aug 2001


Q.

Dear Ab-end: My company is having a rough year and consequently has had to lay off quite a few workers. Since I am the head IS engineer, I need a way to massively delete users from eDirectory with an LDIF file. As you can tell, I am very partial to LDAP but also to eDirectory. -- Lonely in Louisville

A.

Dear Lonely: The following syntax can be used to create an LDIF file that will mass-delete users.

version: 1

dn: cn=Luser0, ou=dirxmltest,ou=spec,o=teds changetype: delete

cn: cn=Luser1, ou=dirxmltest,ou=spec,o=teds changetype: delete

dn: cn=Luser2, ou=dirxmltest,ou=spec,o=teds changetype: delete

You can use a utility such as Novell's BulkLoader or SCHMAP to export the users and specify to just export the Object name. Then use a text editor to search for the string "changetype: add" and replace it with "changetype: delete" as shown above.

Further, if you are working in a UNIX environment, the following line will delete all objects that are contained by an OU called "U":

ldapsearch -h 192.168.1.1 ou=u cn= | ldapdelete -h 192.168.1.1 -v -c -D cn=admin,ou=ou,o=o -w password

This should work on Win32 as well, provided you have the ldapsearch and ldapdelete bins (part of the LDAP SDK that you can download from http://developer. novell.com).

To work, it would need to look like the following:

dn: cn=User1,ou=OU,o=O changetype: delete dn: cn=User2,ou=OU,o=O

changetype: delete

(Answers supplied by Jason Rivard and Israel Forst, both of Novell, Inc.)

* Originally published in Novell AppNotes


Disclaimer

The origin of this information may be internal or external to Novell. While Novell makes all reasonable efforts to verify this information, Novell does not make explicit or implied claims to its validity.

© Copyright Micro Focus or one of its affiliates