LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-11-2017, 10:23 AM   #1
chass
LQ Newbie
 
Registered: May 2013
Posts: 7

Rep: Reputation: Disabled
Question ldapsearch UID and GID from list


Hi everyone,

I'm having a bit of trouble getting the syntax correct for the command below:

ldapsearch -v -h enterprise.server.com -xLLL -D "validuser@server.com" -W -b "OU=Employees,OU=People,DC=server,DC=com" uidNumber gidNumber -f list.txt > list.out.txt

The above command works, it prompts me for my password after I hit enter, but it seems to ignore the "list.txt" option I specify at the end and produces a list of "every" user in our AD database. All I want is for the command view the list.txt file and produce those UIDs and GIDs. Any help is appreciated.

Thank you.
 
Old 01-11-2017, 12:28 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Haven't used the "-f" myself but this link:
https://www.centos.org/docs/5/html/C...dapsearch.html

Has an example:
Quote:
The set of attributes returned here can be limited by specifying the attribute names at the end of the search line. For example, the following ldapsearch command performs both searches but returns only the DN and the givenname and sn attributes of each entry:

ldapsearch -h mozilla -f searchdb sn givenname

That suggests you should probably specify your "uidNumber gidNumber" AFTER your "-f list.txt" rather than before it.
 
  


Reply

Tags
active directory, ldap, ldapsearch



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Differences between UID 0 and GID 0? dwarf007 Linux - Newbie 6 03-16-2010 04:52 AM
mount with given uid,gid ernst Linux - General 1 09-11-2008 08:04 AM
what is uid and gid rmanocha Linux - Software 9 08-18-2008 11:03 PM
What is my uid/gid? Jeebizz Slackware 2 11-22-2005 11:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:14 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