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

Re: LDAP Update Script



On Wednesday 25 June 2008 07:54:29 Aravind Arjunan wrote:
> Dear all,
>
> I had configured openldap in RHEL 5 operating system in master slave.
> Its working fine and entries are also adding without any problem.
> But i need to add entries for 15000 users.
> So it is hard for me to add in ldap browser or in command line for these
> much users.
>
> So i need to know is there any script or utility is there to add all the
> users entries at a time
> like adding all the entries in text file and update it by a command.
> if it so plz tell me it will be very  helpfull for me.

Sure, you can quite easily make a template ldif file, then call 


sed -e "s/%USERNAME%/$user/g" template.ldif >> import.ldif

or similar, then use ldapadd to add the ldif file.

Almost none of this is actually related to OpenLDAP, it's mostly a scripting 
problem, and for that you need to consult a forum for your preferred 
scripting language (whether that be shell + OpenLDAP utilities, or perl, 
python, ruby etc.).


Regards,
Buchan