[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Deleting hundreds of Entry under a OU



Daniel,

please keep responses on the list so others can comment and learn as well.

Daniel Spannbauer wrote:
> 
> Michael Ströder schrieb:
>> Daniel Spannbauer wrote:
>>> Hello,
>>>
>>> I have to deleted abount 500 Entrys under a OU in my LDAP-Tree cause I
>>> have to change the objectClass from "account" to "inetorgPerson".
>>> Can I do this with ldapdelete? I always used that tool only to delete
>>> one entry.
>> Yes. But you have to provide a file with a list of the DNs of the
>> entries to be deleted.
>>
>> $ ldapdelete -h
>> usage: ldapdelete [options] [dn]...
>> 	dn: list of DNs to delete. If not given, it will be readed from stdin
>> 	    or from the file specified with "-f file".
>>
>> (You could also use some of the GUI LDAP clients for that. E.g. my
>> web2ldap supports recursive deletion of all entries below an entry.)
> 
> Thats a posibility. But the ldap-Entries are genarated by a Script. So I
> have to delete it also by this script. So a gui is not the solution that
> I prefer.

In this case I'd prefer to use a full-featured scripting language with a
decent LDAP module to do the job. You have more control in the case of
an error than with invoking command-line tools from a shell script.

Ciao, Michael.