LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-11-2010, 04:50 PM   #1
fantasygoat
Member
 
Registered: Sep 2009
Posts: 119

Rep: Reputation: 17
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.
 
Old 06-12-2010, 04:13 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
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.

Last edited by druuna; 06-12-2010 at 01:08 PM. Reason: Fixed a typo
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Add user from Command line darkapolloslx Linux - Newbie 1 12-29-2008 12:45 AM
how to add user on ldap finsh Linux - Server 3 01-23-2008 08:09 AM
Need a user friendly tool for users to change ldap userpassword Niceman2005 Linux - Software 3 08-27-2007 08:54 PM
How To Add user in Fedora Core 4 using the Command Line Interface regnox Linux - Newbie 9 08-22-2005 12:30 AM
ldap user add prob berrance Linux - Software 0 03-15-2005 08:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration