LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   LDAP command line search. (https://www.linuxquestions.org/questions/linux-newbie-8/ldap-command-line-search-704191/)

knockout_artist 02-12-2009 10:05 AM

LDAP command line search.
 
Hi,

I need to use command line some thing like

Code:

ldapserarch  -x -b < dc object  etc>
I am log into the server too.

But I have no idea what "dc" "dn" to use for my search.

I can see how users/group are setup from novell web interface.

Any ideas?

Thanks

bathory 02-12-2009 11:40 AM

You can start by running:
Code:

ldapsearch -x -b 'dc=domain,dc=com' '(objectclass=*)'
for anonymous search, or
Code:

ldapsearch -x -D "cn=admin,dc=domain,dc=com" -W 'dc=domain,dc=com' '(objectclass=*)'
for a search using the admin credentials, if you don't allow anonymous searches.
Both will return all the existing entries. If you want to search something specific use the results of the previous commands as attributes reference. For example if you want to find all uids and email addresses you can run:
Code:

ldapsearch -x -b 'dc=domain,dc=com' '(objectclass=*)' uid mail
Regards


All times are GMT -5. The time now is 08:22 PM.