<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Ldap on Evan Hoffman</title><link>https://evan.wtf/tags/ldap/</link><description>Recent content in Ldap on Evan Hoffman</description><generator>Hugo</generator><language>en-US</language><copyright>Evan Hoffman</copyright><lastBuildDate>Thu, 28 Oct 2010 17:16:12 +0000</lastBuildDate><atom:link href="https://evan.wtf/tags/ldap/index.xml" rel="self" type="application/rss+xml"/><item><title>Setting up InspIRCd as an internal IRC server for companywide chat</title><link>https://evan.wtf/2010/10/28/setting-up-inspircd-as-an-internal-irc-server-for-companywide-chat/</link><pubDate>Thu, 28 Oct 2010 17:16:12 +0000</pubDate><guid>https://evan.wtf/2010/10/28/setting-up-inspircd-as-an-internal-irc-server-for-companywide-chat/</guid><description>&lt;p&gt;I got this idea (&lt;a href="http://teddziuba.com/2010/01/break-my-concentration-and-i-b.html"&gt;from this blog post&lt;/a&gt;) that it would be cool and great if we had an IRC server to facilitate communication within our team. I started checking out some different IRC servers to see which ones supported the main features I wanted (LDAP auth &amp;amp; SSL). I started out with ratbox but I didn&amp;rsquo;t really like it. I found InspIRCd and after some config tweaking it&amp;rsquo;s working well. Here&amp;rsquo;s the info from modules.conf for authentication against Active Directory (so people login with their AD usernames):&lt;/p&gt;</description></item><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><item><title>ldapsearch on Active Directory</title><link>https://evan.wtf/2010/08/26/ldapsearch-on-active-directory/</link><pubDate>Thu, 26 Aug 2010 10:40:18 +0000</pubDate><guid>https://evan.wtf/2010/08/26/ldapsearch-on-active-directory/</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;</description></item><item><title>Changing Active Directory Password in Browser through OWA 2010</title><link>https://evan.wtf/2010/08/05/changing-active-directory-password-in-browser-through-owa-2010/</link><pubDate>Thu, 05 Aug 2010 11:29:41 +0000</pubDate><guid>https://evan.wtf/2010/08/05/changing-active-directory-password-in-browser-through-owa-2010/</guid><description>&lt;p&gt;A few months ago I was on a quest to figure out how to change my Active Directory password via a browser (for Linux/Mac users). I &lt;a href="https://evan.wtf/2010/01/13/victory-change-active-directory-password-via-ldap-through-browser/"&gt;finally figured it out&lt;/a&gt;, but since I&amp;rsquo;ve been working on this Exchange 2010 migration I noticed one of the features of OWA (Outlook Web App) in Exchange 2010 is that you can change the AD password right in the browser from within the app:&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://evan.wtf/wp-content/uploads/2010/08/change-password-owa1.png"&gt;&lt;img src="https://evan.wtf/wp-content/uploads/2010/08/change-password-owa1.png" alt="" title="Change Password OWA"&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Generate a report of Exchange mailbox sizes broken out by department and location</title><link>https://evan.wtf/2010/04/29/generate-a-report-of-exchange-mailbox-sizes-broken-out-by-department-and-location/</link><pubDate>Thu, 29 Apr 2010 11:44:44 +0000</pubDate><guid>https://evan.wtf/2010/04/29/generate-a-report-of-exchange-mailbox-sizes-broken-out-by-department-and-location/</guid><description>&lt;p&gt;I found a script a few months ago that generated a CSV report of mailbox size, which included the Mailbox Name (usually the user&amp;rsquo;s name), size in Kbytes, number of items, which server it&amp;rsquo;s on, etc. This was very helpful, but I wanted to see which department within the company used the most space on the mail server, and the department wasn&amp;rsquo;t one of the pieces of data included in the report. It took a while but I figured out how to do LDAP lookups in vbscript and was able to add that info, so the report now has the user&amp;rsquo;s department, office location, and quota limit in it as well as the other fields. This makes it very easy to do a PivotChart in Excel to generate a pie chart of the size by department. The script is attached - change the extension to .vbs to run it. You&amp;rsquo;ll need to plug in your Exchange server and domain controller where the placeholders currently are.&lt;/p&gt;</description></item><item><title>Victory! Change Active Directory Password via LDAP through browser</title><link>https://evan.wtf/2010/01/13/victory-change-active-directory-password-via-ldap-through-browser/</link><pubDate>Wed, 13 Jan 2010 13:51:43 +0000</pubDate><guid>https://evan.wtf/2010/01/13/victory-change-active-directory-password-via-ldap-through-browser/</guid><description>&lt;p&gt;I had to give up on PHP and go to Perl, but it turned out not to be so bad. Users can now change their Active Directory passwords via a self-service web page that doesn&amp;rsquo;t require admin credentials. The Perl code is below. Authentication to the script is done via .htaccess LDAP authentication, so the REMOTE_USER env variable is assumed to contain the user&amp;rsquo;s username (sAMAccountName) by the time this script is called. There is a simple check for $ENV{HTTPS} to ensure the script is called via SSL, and AD requires password changes to be done via ldaps, so the whole thing &lt;em&gt;should&lt;/em&gt; be encrypted end to end.&lt;/p&gt;</description></item><item><title>LDAP-Active Directory authentication, Part 3</title><link>https://evan.wtf/2010/01/08/ldap-active-directory-authentication-part-3/</link><pubDate>Fri, 08 Jan 2010 19:12:34 +0000</pubDate><guid>https://evan.wtf/2010/01/08/ldap-active-directory-authentication-part-3/</guid><description>&lt;p&gt;So I got everything working with .htaccess and AD/LDAP authentication. Just add LDAPVerifyServerCert Off to the httpd config to let Apache authenticate against an AD server with a self-signed certificate (without dealing with the annoyance of putting the cert on each Apache server).&lt;/p&gt;&#10;&lt;p&gt;With that piece of the puzzle largely solved, I moved on to another: how will users change their passwords (which are all stored in Active Directory)? For users running Windows this is pretty trivial &amp;ndash; they can do it right in Windows when they&amp;rsquo;re logged into the domain. But what about Linux users? I figured the easiest thing to do would be to make a web form to do this. The user would login (with the http/LDAP auth I previously setup) and the form would ask for their password (twice) and update it in Active Directory. Sounds pretty simple to me. I think if this were OpenLDAP it probably would be, but being AD, it&amp;rsquo;s not.&lt;/p&gt;</description></item><item><title>Single sign-on with Linux clients and Active Directory LDAP, Part 2</title><link>https://evan.wtf/2010/01/05/single-sign-on-with-linux-clients-and-active-directory-ldap-part-2/</link><pubDate>Tue, 05 Jan 2010 18:45:55 +0000</pubDate><guid>https://evan.wtf/2010/01/05/single-sign-on-with-linux-clients-and-active-directory-ldap-part-2/</guid><description>&lt;p&gt;Following up on &lt;a href="https://evan.wtf/evan/2009/12/25/single-sign-on-with-linux-clients-and-active-directory-ldap-part-1/"&gt;my previous post&lt;/a&gt;, it turned out not to be as big of a deal as I&amp;rsquo;d originally expected to have Apache authenticate against AD and only allow users whose accounts weren&amp;rsquo;t disabled. In a nutshell, here&amp;rsquo;s what I did:&lt;/p&gt;&#10;&lt;p&gt;In your .htaccess file:&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;AuthBasicProvider ldap&#10;AuthType basic&#10;AuthName &amp;#34;AD LDAP Test&amp;#34;&#10;AuthLDAPURL &amp;#34;ldap://activedirectory.example.com/OU=Users,DC=example,DC=com?sAMAccountName?sub?(!(userAccountControl:1.2.840.113556.1.4.803:=2))&amp;#34;&#10;AuthzLDAPAuthoritative On&#10;AuthLDAPGroupAttribute member&#10;AuthLDAPBindDN ldapuser@example.com&#10;AuthLDAPBindPassword password&#10;Require ldap-group CN=Sysadmins,OU=Internal Groups,OU=Groups,DC=example,DC=com&#10;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The key here is this LDAP filter: &lt;strong&gt;(!(userAccountControl:1.2.840.113556.1.4.803:=2))&lt;/strong&gt;. This is the bitwise &amp;ldquo;AND&amp;rdquo; of the userAccountControl field and the decimal number 2, which is Microsoft&amp;rsquo;s value for &amp;ldquo;account is disabled.&amp;rdquo; The codes are listed here: &lt;a href="http://support.microsoft.com/kb/305144"&gt;http://support.microsoft.com/kb/305144&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Single sign-on with Linux clients and Active Directory LDAP, Part 1</title><link>https://evan.wtf/2009/12/25/single-sign-on-with-linux-clients-and-active-directory-ldap-part-1/</link><pubDate>Fri, 25 Dec 2009 00:20:15 +0000</pubDate><guid>https://evan.wtf/2009/12/25/single-sign-on-with-linux-clients-and-active-directory-ldap-part-1/</guid><description>&lt;p&gt;One project we&amp;rsquo;ve been working on for a while is single sign-on across all our servers and other services (e.g. SVN repository, a few other things). One thing I wanted to avoid, I guess for mostly religious reasons, was reliance on a Windows instance for any of our production environment. The logical part of my brain knows that people build huge websites with Windows farms and AD, but my gut still doesn&amp;rsquo;t trust it. So what I wanted to do was setup OpenLDAP as a &amp;ldquo;slave&amp;rdquo; to an Active Directory &amp;ldquo;master&amp;rdquo; and have all the LDAP info propagate over the slave whenever any changes were made in the master. I&amp;rsquo;ve done this with DNS - setup Bind as a slave to an AD server and everything basically works as I expect in a Bind-Bind master/slave scenario. Well, it turns out that it doesn&amp;rsquo;t work like that when it comes to LDAP. Apparently AD doesn&amp;rsquo;t follow the RFC for LDAP (surprise!) so many things that would be expected to work with OpenLDAP won&amp;rsquo;t.&lt;/p&gt;</description></item></channel></rss>