<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Example on Evan Hoffman</title><link>https://evan.wtf/tags/example/</link><description>Recent content in Example on Evan Hoffman</description><generator>Hugo</generator><language>en-US</language><copyright>Evan Hoffman</copyright><lastBuildDate>Thu, 26 Aug 2010 10:40:18 +0000</lastBuildDate><atom:link href="https://evan.wtf/tags/example/index.xml" rel="self" type="application/rss+xml"/><item><title>ldapsearch example on Active Directory</title><link>https://evan.wtf/2010/08/26/ldapsearch-on-active-directory-2/</link><pubDate>Thu, 26 Aug 2010 10:40:18 +0000</pubDate><guid>https://evan.wtf/2010/08/26/ldapsearch-on-active-directory-2/</guid><description>&lt;p&gt;Just putting this here for safekeeping since I couldn&amp;rsquo;t remember the exact syntax.&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;[evan@ehoffman 10:35:50 ~]$ ldapsearch -x -LLL -D &amp;#34;ldapuser@example.com&amp;#34; -w password -b &amp;#34;OU=Users,DC=example,DC=com&amp;#34; -s sub -H ldaps://activedirectory.example.com &amp;#34;(sn=hoffman)&amp;#34; cn mail displayName samaccountname&#10;dn: CN=Evan Hoffman,OU=Tech,OU=Users,DC=example,DC=com&#10;cn: Evan Hoffman&#10;displayName: Evan D. Hoffman&#10;sAMAccountName: ehoffman&#10;mail: Evan.Hoffman@example.com&#10;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Explanation: Connect to &lt;strong&gt;activedirectory.example.com&lt;/strong&gt; using ldaps (SSL) with simple authentication, binding as &lt;strong&gt;&lt;a href="mailto:ldapuser@example.com"&gt;ldapuser@example.com&lt;/a&gt;&lt;/strong&gt; with password &lt;strong&gt;password&lt;/strong&gt;; search for &lt;strong&gt;(sn=hoffman)&lt;/strong&gt; within the &lt;strong&gt;OU=Users,DC=example,DC=com&lt;/strong&gt; search base (branch), and search the &lt;strong&gt;sub&lt;/strong&gt;tree. Return the &lt;strong&gt;cn&lt;/strong&gt;, &lt;strong&gt;displayName&lt;/strong&gt;, and &lt;strong&gt;samaccountname&lt;/strong&gt; fields.&lt;/p&gt;</description></item></channel></rss>