ldapsearch

ldapsearch -o ldif-wrap=no -LLL -D user@mydomain.com -W -h ldap.mydomain.com "(&(sAMAccountName=$user)(objectClass=user))" -b "DC=mydomain,DC=com" name sAMAccountName mail |sed -e '/^#/d' -e '/^dn:/d' -e '/^$/d'

Index