LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-03-2005, 06:28 PM   #1
paul_mat
Member
 
Registered: Nov 2004
Location: Townsville, Australia
Distribution: Fedora Core 5, CentOS 4, RHEL 4
Posts: 855

Rep: Reputation: 30
script for getting user information from LDAP


hi there,

i'm looking for a script that will grab user information from MS active directory and pipe it into a text document. i was thinking it could maybe use the openLDAP tools to bind with ADS and then pull down the information. i'm hopeless with the openldap tools so even if someone could just post the command for binding to a LDAP server and then searching for the 'mail' attribute and outputting it that would be great.
 
Old 11-03-2005, 09:30 PM   #2
paul_mat
Member
 
Registered: Nov 2004
Location: Townsville, Australia
Distribution: Fedora Core 5, CentOS 4, RHEL 4
Posts: 855

Original Poster
Rep: Reputation: 30
okay, so far i've got this command

[root@fedora bash]# ldapsearch -LLL -x -D "cn=moodleuser,dc=example,dc=com" -h senior-server.example.com -b "dc=example,dc=com" -w Password mail=*@* -S mail=*@* sAMAccountName mail > /home/ldap/output.txt

and it's giving me this output

dn: cn=moodleuser,dc=example,dc=com
mail: moodle.user@example.com
sAMAccountName: moodleuser

what i REALLY want is just

moodleuser: moodle.user

what i really want is to be able to edit the output of the 'ldapsearch' command, but if thats not possable i was thinking that maybe a second script would be good. one that edits out the unnecessary information? so i'm looking for maybe a command that counts characters and lines or something like that and a command that can delete characters.

Last edited by paul_mat; 11-03-2005 at 10:31 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
LDAP server not starting as user LDAP klnasveschuk Fedora 1 02-15-2007 05:49 AM
What is script PID information? Stepaj47 Linux - Newbie 7 11-15-2005 03:50 PM
how to access LDAP information msound Linux - Networking 5 06-27-2005 10:10 PM
LDAP Authentication w/ Local User Information Adrian W Linux - Security 13 08-17-2004 12:09 PM
more user information Goatdemon LQ Suggestions & Feedback 4 07-05-2002 03:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:36 PM.

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