<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Victory!  Change Active Directory Password via LDAP through browser</title>
	<atom:link href="http://www.evanhoffman.com/evan/2010/01/13/victory-change-active-directory-password-via-ldap-through-browser/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.evanhoffman.com/evan/2010/01/13/victory-change-active-directory-password-via-ldap-through-browser/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=victory-change-active-directory-password-via-ldap-through-browser</link>
	<description>So I can pass it off</description>
	<lastBuildDate>Sat, 28 Jan 2012 05:15:20 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: matt</title>
		<link>http://www.evanhoffman.com/evan/2010/01/13/victory-change-active-directory-password-via-ldap-through-browser/#comment-2438</link>
		<dc:creator>matt</dc:creator>
		<pubDate>Wed, 02 Nov 2011 00:48:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.evanhoffman.com/evan/?p=321#comment-2438</guid>
		<description>Thanks for this, really helped me out.  For others trying to do this in python you need something like this:

c.modify_s(dn, [(ldap.MOD_DELETE, &#039;unicodePwd&#039;, old_password), (ldap.MOD_ADD, &#039;unicodePwd&#039;, new_password)])

this performs a password CHANGE.  if you have bound with a user who has password RESET power you can do this:

c.modify_s(dn, [(ldap.MOD_REPLACE, &#039;unicodePwd&#039;, new_password)])

You need to be connected using SSL (via port 636) and since most AD servers appear to use selfsigned certs you will have to either add the cert to your tool chain or do something like this:
   ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_ALLOW)
   ldap.set_option(ldap.OPT_REFERRALS, 0)
(not sure what the second line is for).

Oh, one last thing, to make those passwords use this:
new_password = unicode(&quot;\&quot;&quot; + &#039;secret&#039; + &quot;\&quot;&quot;, &quot;iso-8859-1&quot;).encode(&quot;utf-16-le&quot;)</description>
		<content:encoded><![CDATA[<p>Thanks for this, really helped me out.  For others trying to do this in python you need something like this:</p>
<p>c.modify_s(dn, [(ldap.MOD_DELETE, 'unicodePwd', old_password), (ldap.MOD_ADD, 'unicodePwd', new_password)])</p>
<p>this performs a password CHANGE.  if you have bound with a user who has password RESET power you can do this:</p>
<p>c.modify_s(dn, [(ldap.MOD_REPLACE, 'unicodePwd', new_password)])</p>
<p>You need to be connected using SSL (via port 636) and since most AD servers appear to use selfsigned certs you will have to either add the cert to your tool chain or do something like this:<br />
   ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_ALLOW)<br />
   ldap.set_option(ldap.OPT_REFERRALS, 0)<br />
(not sure what the second line is for).</p>
<p>Oh, one last thing, to make those passwords use this:<br />
new_password = unicode(&#8220;\&#8221;" + &#8216;secret&#8217; + &#8220;\&#8221;", &#8220;iso-8859-1&#8243;).encode(&#8220;utf-16-le&#8221;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jquest07</title>
		<link>http://www.evanhoffman.com/evan/2010/01/13/victory-change-active-directory-password-via-ldap-through-browser/#comment-2327</link>
		<dc:creator>jquest07</dc:creator>
		<pubDate>Wed, 05 Oct 2011 22:18:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.evanhoffman.com/evan/?p=321#comment-2327</guid>
		<description>First of all, thanks for this great information.

I&#039;m trying to do this on Red Hat 6 and found that Unicode::String is not available.  After looking into what it would take to install this module I found that perl has encoding capability built in that will do the trick.  Here&#039;s the code to do the encoding I was able to get to work:

use Encode qw(encode decode);
my $oldUniPW = encode(&quot;UTF-16LE&quot;,&#039;&quot;&#039;.$oldpw.&#039;&quot;&#039;);
my $newUniPW = encode(&quot;UTF-16LE&quot;,&#039;&quot;&#039;.$newpw.&#039;&quot;&#039;);</description>
		<content:encoded><![CDATA[<p>First of all, thanks for this great information.</p>
<p>I&#8217;m trying to do this on Red Hat 6 and found that Unicode::String is not available.  After looking into what it would take to install this module I found that perl has encoding capability built in that will do the trick.  Here&#8217;s the code to do the encoding I was able to get to work:</p>
<p>use Encode qw(encode decode);<br />
my $oldUniPW = encode(&#8220;UTF-16LE&#8221;,&#8217;&#8221;&#8216;.$oldpw.&#8217;&#8221;&#8216;);<br />
my $newUniPW = encode(&#8220;UTF-16LE&#8221;,&#8217;&#8221;&#8216;.$newpw.&#8217;&#8221;&#8216;);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: evan</title>
		<link>http://www.evanhoffman.com/evan/2010/01/13/victory-change-active-directory-password-via-ldap-through-browser/#comment-89</link>
		<dc:creator>evan</dc:creator>
		<pubDate>Wed, 16 Feb 2011 01:36:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.evanhoffman.com/evan/?p=321#comment-89</guid>
		<description>A working .htaccess with LDAP auth is here:

http://www.evanhoffman.com/evan/?p=298

Evan</description>
		<content:encoded><![CDATA[<p>A working .htaccess with LDAP auth is here:</p>
<p><a href="http://www.evanhoffman.com/evan/?p=298" rel="nofollow">http://www.evanhoffman.com/evan/?p=298</a></p>
<p>Evan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pablo</title>
		<link>http://www.evanhoffman.com/evan/2010/01/13/victory-change-active-directory-password-via-ldap-through-browser/#comment-81</link>
		<dc:creator>Pablo</dc:creator>
		<pubDate>Fri, 11 Feb 2011 19:50:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.evanhoffman.com/evan/?p=321#comment-81</guid>
		<description>Thank you very much! I think it would be convenient to include a link for the .htaccess LDAP authentication such as this one: http://www.yolinux.com/TUTORIALS/LinuxTutorialApacheAddingLoginSiteProtection.html#LDAP</description>
		<content:encoded><![CDATA[<p>Thank you very much! I think it would be convenient to include a link for the .htaccess LDAP authentication such as this one: <a href="http://www.yolinux.com/TUTORIALS/LinuxTutorialApacheAddingLoginSiteProtection.html#LDAP" rel="nofollow">http://www.yolinux.com/TUTORIALS/LinuxTutorialApacheAddingLoginSiteProtection.html#LDAP</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: risha</title>
		<link>http://www.evanhoffman.com/evan/2010/01/13/victory-change-active-directory-password-via-ldap-through-browser/#comment-77</link>
		<dc:creator>risha</dc:creator>
		<pubDate>Thu, 27 Jan 2011 13:17:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.evanhoffman.com/evan/?p=321#comment-77</guid>
		<description>Hi Ivan,
can u advise me how to call this perl script through php.I gues si can use passthrough but i ness to pass parameters like basedn,userid,pwd etch.
Kindly advise</description>
		<content:encoded><![CDATA[<p>Hi Ivan,<br />
can u advise me how to call this perl script through php.I gues si can use passthrough but i ness to pass parameters like basedn,userid,pwd etch.<br />
Kindly advise</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sergio</title>
		<link>http://www.evanhoffman.com/evan/2010/01/13/victory-change-active-directory-password-via-ldap-through-browser/#comment-76</link>
		<dc:creator>Sergio</dc:creator>
		<pubDate>Wed, 19 Jan 2011 08:06:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.evanhoffman.com/evan/?p=321#comment-76</guid>
		<description>Hi Evan,

I need your script, becouse I have linux machine integrated with Active Directory (ldap only, not kerberos) and need change user password, but I don&#039;t know to check your script, I don&#039;t know perl and php. Can you said me that steps (conceptual) I have to check it?

A lot of thanks

P.D: Sorry for my English</description>
		<content:encoded><![CDATA[<p>Hi Evan,</p>
<p>I need your script, becouse I have linux machine integrated with Active Directory (ldap only, not kerberos) and need change user password, but I don&#8217;t know to check your script, I don&#8217;t know perl and php. Can you said me that steps (conceptual) I have to check it?</p>
<p>A lot of thanks</p>
<p>P.D: Sorry for my English</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: evan</title>
		<link>http://www.evanhoffman.com/evan/2010/01/13/victory-change-active-directory-password-via-ldap-through-browser/#comment-75</link>
		<dc:creator>evan</dc:creator>
		<pubDate>Tue, 30 Mar 2010 18:54:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.evanhoffman.com/evan/?p=321#comment-75</guid>
		<description>Actually, I tried a bunch of different things and some of them worked &quot;halfway.&quot;  I sent raw LDIF records directly to the AD server and that worked, so I assumed there had to be some way to do it via code, even if it came down to opening a raw socket.  The Perl script I have in use does work though, with the &quot;modify&quot; command.  I think as long as the delete/add takes place in a single transaction (and you provide the old password) it does work.  The problem with PHP, iirc, was that it implemented the delete/add as two separate operations.</description>
		<content:encoded><![CDATA[<p>Actually, I tried a bunch of different things and some of them worked &#8220;halfway.&#8221;  I sent raw LDIF records directly to the AD server and that worked, so I assumed there had to be some way to do it via code, even if it came down to opening a raw socket.  The Perl script I have in use does work though, with the &#8220;modify&#8221; command.  I think as long as the delete/add takes place in a single transaction (and you provide the old password) it does work.  The problem with PHP, iirc, was that it implemented the delete/add as two separate operations.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason Fried</title>
		<link>http://www.evanhoffman.com/evan/2010/01/13/victory-change-active-directory-password-via-ldap-through-browser/#comment-74</link>
		<dc:creator>Jason Fried</dc:creator>
		<pubDate>Tue, 30 Mar 2010 18:05:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.evanhoffman.com/evan/?p=321#comment-74</guid>
		<description>Instead of using  charmap. you can convert the password to UTF16 Little Endian in a simple fashion using just Unicode::String

my $UTF16pass = Unicode::String::utf8(&quot;\&quot;$password\&quot;&quot;)-&gt;utf16le();

Which makes more sense than byte swap.

Does the modify method work for password reset?
I found that i had to use an admin account with replace to get it to work. And most sites I saw said the modify method was broken with Active Directory.</description>
		<content:encoded><![CDATA[<p>Instead of using  charmap. you can convert the password to UTF16 Little Endian in a simple fashion using just Unicode::String</p>
<p>my $UTF16pass = Unicode::String::utf8(&#8220;\&#8221;$password\&#8221;")-&gt;utf16le();</p>
<p>Which makes more sense than byte swap.</p>
<p>Does the modify method work for password reset?<br />
I found that i had to use an admin account with replace to get it to work. And most sites I saw said the modify method was broken with Active Directory.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

