hi,
i had configured openldap in RHEL 5. It was in master/slave replication in syncrepl method (refreshOnly) method.
I had to add users information in the ldap database. Nearly 15000 users are there so i can able to add all the 15000 users infromation at a time.
so i need a script or some utility to add all the user infromation at the same time. Am using LDAP Browser for adding the entries now.
so plz help me how to add all the users information at single time.
On Wednesday 16 July 2008 11:11:16 Aravind Arjunan wrote:
hi,
i had configured openldap in RHEL 5. It was in master/slave replication in syncrepl method (refreshOnly) method.
I had to add users information in the ldap database. Nearly 15000 users are there so i can able to add all the 15000 users infromation at a time.
so i need a script or some utility to add all the user infromation at the same time. Am using LDAP Browser for adding the entries now.
so plz help me how to add all the users information at single time.
You need to provide more information on where this information that you need to add is, otherwise you will get an answer to use ldapadd or slapadd to add the users (which would be entirely relevant with the minimal information you have provided so far - I can easily write a "one-line" bash script that would create the LDIF for ldapadd to use).
Regards, Buchan
Hello,
Do you need to add complete users or do you need to add specific data to the existing users?
If you need to add users, I would generate an LDIF and just import that.
Or, you can use Perl Net::LDAP and then either add or modify the entries.
Without additional information, it is a bit difficult to actually help you.
Best regards,
Claus
________________________________
Von: openldap-technical-bounces+claus.kick=siemens.com@OpenLDAP.org [mailto:openldap-technical-bounces+claus.kick=siemens.com@OpenLDAP.org] Im Auftrag von Aravind Arjunan Gesendet: Mittwoch, 16. Juli 2008 11:11 An: openldap-technical@openldap.org Betreff: script for adding users information in ldap database
hi,
i had configured openldap in RHEL 5. It was in master/slave replication in syncrepl method (refreshOnly) method.
I had to add users information in the ldap database. Nearly 15000 users are there so i can able to add all the 15000 users infromation at a time.
so i need a script or some utility to add all the user infromation at the same time. Am using LDAP Browser for adding the entries now.
so plz help me how to add all the users information at single time.
I have a question along similar lines. We use Uportal and Moodle and I want to set up an LDAP server for those applications to authenticate users. I want to take the users in the Uportal MySQL database and migrate them to an LDIF file. Has anyone done this? I am assuming I will have to write some sort of script to create the LDIF file. Does anyone have an example of a script that does something similar? Anything that involves getting data out of a MySQL database and creating an LDIF file with it would be really helpful.
Thanks so much, Kristen
PS Thanks for all of the earlier help with my LDAP woes. Things are working better now. I installed from source. It was harder than using apt-get, but it actually works now. And I got the phpldapadmin working with the server I set up and can see the example entries I put in, so things are a lot better. Now I just have to figure out what schema to use and the best way to represent our users in an ldif file - oh yeah, and how to create an ldif file from our mysql database :)
On 7/16/08 2:54 AM, "Kick, Claus" claus.kick@siemens.com wrote:
Hello,
Do you need to add complete users or do you need to add specific data to the existing users?
If you need to add users, I would generate an LDIF and just import that.
Or, you can use Perl Net::LDAP and then either add or modify the entries.
Without additional information, it is a bit difficult to actually help you.
Best regards,
Claus
Von: openldap-technical-bounces+claus.kick=siemens.com@OpenLDAP.org [mailto:openldap-technical-bounces+claus.kick=siemens.com@OpenLDAP.org] Im Auftrag von Aravind Arjunan Gesendet: Mittwoch, 16. Juli 2008 11:11 An: openldap-technical@openldap.org Betreff: script for adding users information in ldap database
hi,
i had configured openldap in RHEL 5. It was in master/slave replication in syncrepl method (refreshOnly) method.
I had to add users information in the ldap database. Nearly 15000 users are there so i can able to add all the 15000 users infromation at a time.
so i need a script or some utility to add all the user infromation at the same time. Am using LDAP Browser for adding the entries now.
so plz help me how to add all the users information at single time.
-- Kristen Walker
Digital Media Resources Developer Instructional Media Services Santa Barbara County Education Office 4400 Cathedral Oaks Road P.O. Box 6307 Santa Barbara, CA 93160-6307 (805)964-4711 ext. 5244/FAX (805)683-3597 kwalker@sbceo.org http://www.sbceoportal.org
On Wed, Jul 16, 2008 at 5:15 PM, Kristen Walker kwalker@sbceo.org wrote:
I have a question along similar lines. We use Uportal and Moodle and I want to set up an LDAP server for those applications to authenticate users. I want to take the users in the Uportal MySQL database and migrate them to an LDIF file. Has anyone done this? I am assuming I will have to write some sort of script to create the LDIF file. Does anyone have an example of a script that does something similar? Anything that involves getting data out of a MySQL database and creating an LDIF file with it would be really helpful.
mysql -u root -p -e 'select email, password from posta.users' | awk 'NR != 1 { printf "dn: uid=%s, dc=example\nobjectclass: myObjectClass\nuserpassword: %s\n\n", $1, $2 }'
(the NR != 1 part is required to discard the first line mysql outputs)
this is how i migrated my mail users from mysql to ldap, it has a catch tho, it won't work if your records have spaces in them. in that case you are probably better with perl than with shell, but since i'm a bash guy and not a perl guy i'd do stuff like:
mysql -u root -p -e $'select email, "\a", password from posta.users' | awk -F$'\a' 'NR != 1 { printf "dn: %s\nobjectclass: myObjectClass\nuserpassword: %s\n\n", $1, $2 }'
it requires bash and it will work as long as your fileds don't have an ascii bell in them.
Thank you! This is exactly what I was looking for.
Thanks a million, Kristen
-- Kristen Walker
Digital Media Resources Developer Instructional Media Services Santa Barbara County Education Office 4400 Cathedral Oaks Road P.O. Box 6307 Santa Barbara, CA 93160-6307 (805)964-4711 ext. 5244/FAX (805)683-3597 kwalker@sbceo.org http://www.sbceoportal.org
On 7/16/08 9:36 AM, "Almir Karic" redduck666@gmail.com wrote:
On Wed, Jul 16, 2008 at 5:15 PM, Kristen Walker kwalker@sbceo.org wrote:
I have a question along similar lines. We use Uportal and Moodle and I want to set up an LDAP server for those applications to authenticate users. I want to take the users in the Uportal MySQL database and migrate them to an LDIF file. Has anyone done this? I am assuming I will have to write some sort of script to create the LDIF file. Does anyone have an example of a script that does something similar? Anything that involves getting data out of a MySQL database and creating an LDIF file with it would be really helpful.
mysql -u root -p -e 'select email, password from posta.users' | awk 'NR != 1 { printf "dn: uid=%s, dc=example\nobjectclass: myObjectClass\nuserpassword: %s\n\n", $1, $2 }'
(the NR != 1 part is required to discard the first line mysql outputs)
this is how i migrated my mail users from mysql to ldap, it has a catch tho, it won't work if your records have spaces in them. in that case you are probably better with perl than with shell, but since i'm a bash guy and not a perl guy i'd do stuff like:
mysql -u root -p -e $'select email, "\a", password from posta.users' | awk -F$'\a' 'NR != 1 { printf "dn: %s\nobjectclass: myObjectClass\nuserpassword: %s\n\n", $1, $2 }'
it requires bash and it will work as long as your fileds don't have an ascii bell in them.
Kristen Walker wrote:
I have a question along similar lines. We use Uportal and Moodle and I want to set up an LDAP server for those applications to authenticate users. I want to take the users in the Uportal MySQL database and migrate them to an LDIF file. Has anyone done this? I am assuming I will have to write some sort of script to create the LDIF file. Does anyone have an example of a script that does something similar? Anything that involves getting data out of a MySQL database and creating an LDIF file with it would be really helpful.
This should give you an idea:
http://www.stroeder.com/pylib/egadr2ldap.py
But it's syncing from mySQL to OpenLDAP via LDAP. And there's no data sanitizing at all.
Ciao, Michael.
openldap-technical@openldap.org