Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - General
User Name
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.


  Search this Thread
Old 01-11-2017, 11:23 AM   #1
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 -xLLL -D "" -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, 01:28 PM   #2
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,053
Blog Entries: 14

Rep: Reputation: 1226Reputation: 1226Reputation: 1226Reputation: 1226Reputation: 1226Reputation: 1226Reputation: 1226Reputation: 1226Reputation: 1226
Haven't used the "-f" myself but this link:

Has an example:
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.


active directory, ldap, ldapsearch

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 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 05:52 AM
mount with given uid,gid ernst Linux - General 1 09-11-2008 09:04 AM
what is uid and gid rmanocha Linux - Software 9 08-19-2008 12:03 AM
What is my uid/gid? Jeebizz Slackware 2 11-22-2005 12:39 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:01 AM.

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