> For the complete documentation index, see [llms.txt](https://kyou00.gitbook.io/xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kyou00.gitbook.io/xyz/commands/view/linux/ldap/ldapsearch.md).

# ldapsearch

<pre data-overflow="wrap"><code><strong># This will return the password policy / password length
</strong>ldapsearch -h 172.16.5.5 -x -b "DC=INLANEFREIGHT,DC=LOCAL" -s sub "*" | grep -m 1 -B 10 pwdHistoryLength
</code></pre>

<pre><code><strong># This will return usernames
</strong>ldapsearch -h 172.16.5.5 -x -b "DC=INLANEFREIGHT,DC=LOCAL" -s sub "(&#x26;(objectclass=user))"  | grep sAMAccountName: | cut -f2 -d" "
</code></pre>
