ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi everyone - By any chance would anyone know if you can do ldapsearch to list of the uid's (about 1000 of them that are saved in a text file) at once and put the output in a file?
I am only able to get one user at a time ... pls help...
I used this to get one uid information...but need to find them all...thanks in advance..
while read UID
do
ldapsearch uid=$UID (whatever the right syntax is for ldapsearch)
done <filename
This works if filename is simply a list of the desired entries. If not, then you have to do more processing to extract the desired fields. (Post some sample entries from your file)
how could I output all information needed to a file?
currently I get this error in the server:
scope should be base, one, or sub
usage: ldapsearch [options] filter [attributes...]
where:
filter RFC-1558 compliant LDAP search filter
attributes whitespace-separated list of attributes to retrieve
(if no attribute list is given, all are retrieved)
options:
-n show what would be done but don't actually search
-v run in verbose mode (diagnostics to standard output)
-t write values to files in /tmp
-u include User Friendly entry names in the output
-A retrieve attribute names only (no values)
-B do not suppress printing of non-ASCII values
-L print entries in LDIF format (-B is implied)
-R do not automatically follow referrals
-d level set LDAP debugging level to `level'
-F sep print `sep' instead of `=' between attribute names and values
-f file perform sequence of searches listed in `file'
-b basedn base dn for search
-s scope one of base, one, or sub (search scope)
-a deref one of never, always, search, or find (alias dereferencing)
-l time lim time limit (in seconds) for search
-z size lim size limit (in entries) for search
-h host ldap server
-p port port on ldap server
-D binddn bind dn
-w passwd bind passwd (for authentication)
-j file read bind passwd from `file'
-M authentication-mechanism CRAM-MD5
scope should be base, one, or sub
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.