Home » Debian, Linux, Quick Tip, Shell, Windows

Quick Tip: How to search in Windows Active Directory from Linux with ldapsearch

16 October 2009 One Comment

Sometimes we need to query, under Linux, Active Directory for users/computers without accessing a remote desktop. We can achieve that with ldapserch. First you should install first ldap-utils. In Debian or Ubuntu just run:

$ sudo apt-get install ldap-utils

The syntax for using ldapsearch:

ldapsearch -x -LLL -h [host] -D [user] -w [password] -b [base DN] -s sub "([filter])" [attribute list]

A simple example

$ ldapsearch -x -LLL -h host.example.com -D user -w password -b"dc=ad,dc=example,dc=com" -s sub "(objectClass=user)" givenName

BlinkList Diigo Digg Facebook Furl Google Mister Wong Newsvine Reddit StumbleUpon Simpy Technorati Yahoo DZone

Hide Bookmarks

One Comment »

  • Fashion designer Colleges said:

    It is truly a nice and useful piece of info. I’m happy that you simply shared this useful info with us. Please keep us up to date like this. Thank you for sharing.

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.