LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   command line tool to add user records to LDAP (https://www.linuxquestions.org/questions/linux-server-73/command-line-tool-to-add-user-records-to-ldap-813624/)

fantasygoat 06-11-2010 04:50 PM

command line tool to add user records to LDAP
 
I'm looking for a script or a tool I can use from the command line, non-interactively, to add users to our LDAP server.

I could write a wrapper for ldapsearch, ldapadd and ldapmodify, or write something from scratch in perl, but I imagine someone has done this already.

druuna 06-12-2010 04:13 AM

Hi,

I'm sure people have written scripts to add/search/modify the content of a LDAP database, I know I have. The thing is that all these scripts are tailored to the specific setup of that database and cannot be used with other setups.

Depending on the complexity of the LDAP setup and the requirements, writing scripts can be easy or a challenge but is doable (also depending on your knowledge of scripting). If your knowledge of perl is good enough I would suggest using it instead of bash/ksh. The possible downside of using a bash script is that for every action you do a new connection is set up, perl on the other hand can open a connection and after that you can do multiple actions before the connection is closed. Do have a look at the Net::LDAP module that is available.

If, on the other hand, your setup is 'simple' and you only need to occasionally add/search/modify one or more entries you could go with a bash script.

Hope this clears things up a bit.


All times are GMT -5. The time now is 01:47 PM.