Adam Williams | 29 Aug 18:25

changing a bunch of ldap entries at once?

I have a bunch of users that have a mail entry I want to delete.  As an 
example:

dn: uid=jdoe$,ou=Computers,dc=mdah,dc=mdah,dc=state,dc=ms,dc=us
mail: jdoe$@mdah.state.ms.us

I know I can delete them one at a time with the following ldif for each 
user and run it manually

dn: uid=jdoe$,ou=Computers,dc=mdah,dc=state,dc=ms,dc=us
changetype: modify
delete: mail
mail: jdoe$@mdah.state.ms.us

but is there a way to automate the process or globally drop mail: from 
every uid in the ou=Computers?

Gavin Henry | 29 Aug 21:45
Favicon
Gravatar

Re: changing a bunch of ldap entries at once?

Adam Williams wrote:
> I have a bunch of users that have a mail entry I want to delete.  As an 
> example:
> 
> dn: uid=jdoe$,ou=Computers,dc=mdah,dc=mdah,dc=state,dc=ms,dc=us
> mail: jdoe$@mdah.state.ms.us
> 
> I know I can delete them one at a time with the following ldif for each 
> user and run it manually
> 
> dn: uid=jdoe$,ou=Computers,dc=mdah,dc=state,dc=ms,dc=us
> changetype: modify
> delete: mail
> mail: jdoe$@mdah.state.ms.us
> 
> but is there a way to automate the process or globally drop mail: from 
> every uid in the ou=Computers?

Script it or export the data, edit with sed and re-import etc.

--

-- 
Kind Regards,

Gavin Henry.
Managing Director.

T +44 (0) 1224 279484
M +44 (0) 7930 323266
F +44 (0) 1224 824887
E ghenry@...
(Continue reading)

Andreas Barth | 29 Aug 21:46

Re: changing a bunch of ldap entries at once?

* Gavin Henry (ghenry@...) [080829 21:44]:
> Adam Williams wrote:
> >I have a bunch of users that have a mail entry I want to delete.  As an 
> >example:
> >
> >dn: uid=jdoe$,ou=Computers,dc=mdah,dc=mdah,dc=state,dc=ms,dc=us
> >mail: jdoe$@mdah.state.ms.us
> >
> >I know I can delete them one at a time with the following ldif for each 
> >user and run it manually
> >
> >dn: uid=jdoe$,ou=Computers,dc=mdah,dc=state,dc=ms,dc=us
> >changetype: modify
> >delete: mail
> >mail: jdoe$@mdah.state.ms.us
> >
> >but is there a way to automate the process or globally drop mail: from 
> >every uid in the ou=Computers?
> 
> Script it or export the data, edit with sed and re-import etc.

That's what ldapvi is for - regular expressions within the full database
without issues.

Cheers,
Andi
--

-- 
  http://home.arcor.de/andreas-barth/

(Continue reading)

Gavin Henry | 29 Aug 21:51
Favicon
Gravatar

Re: changing a bunch of ldap entries at once?

> That's what ldapvi is for - regular expressions within the full database
> without issues.

If he can install it that is, but yeah reach for that too.

--

-- 
Kind Regards,

Gavin Henry.

T +44 (0) 1224 279484
M +44 (0) 7930 323266
F +44 (0) 1224 824887
E ghenry@...

Open Source. Open Solutions(tm).

http://www.suretecsystems.com/

Adam Williams | 29 Aug 22:36

Re: changing a bunch of ldap entries at once?

Andreas Barth wrote:
> That's what ldapvi is for - regular expressions within the full database
> without issues.
>
>
> Cheers,
> Andi
>   

thanks, wasn't aware of ldapvi.  yum -y install ldapvi installed it for 
me, and then opened it up and ran :%g/$@/d and it took care of it for me

Dustin Puryear | 2 Oct 20:27

Re: changing a bunch of ldap entries at once?

ldapvi! Very interesting tool. I tried it after reading this email.

> * Gavin Henry (ghenry@...) [080829 21:44]:
>> Adam Williams wrote:
>> >I have a bunch of users that have a mail entry I want to delete.  As an
>> >example:
>> >
>> >dn: uid=jdoe$,ou=Computers,dc=mdah,dc=mdah,dc=state,dc=ms,dc=us
>> >mail: jdoe$@mdah.state.ms.us
>> >
>> >I know I can delete them one at a time with the following ldif for each
>> >user and run it manually
>> >
>> >dn: uid=jdoe$,ou=Computers,dc=mdah,dc=state,dc=ms,dc=us
>> >changetype: modify
>> >delete: mail
>> >mail: jdoe$@mdah.state.ms.us
>> >
>> >but is there a way to automate the process or globally drop mail: from
>> >every uid in the ou=Computers?
>>
>> Script it or export the data, edit with sed and re-import etc.
>
> That's what ldapvi is for - regular expressions within the full database
> without issues.
>
>
> Cheers,
> Andi
> --
(Continue reading)


Gmane