Active Directory (ADAM) on Windows Server 2000 SP4 .Net 1.1 does not work<p align=left>I am working for a large banking client who have older infrastructure in the Application services layer.</p> <p align=left> </p> <p align=left>I have created a COM+ component that resides in an Application server with the following specs:</p> <p align=left>* Windows Server 2000 SP4</p> <p align=left>* .Net Framework 1.1</p> <p align=left>* has its own workgroup</p> <p align=left> </p> <p align=left>This component communicates to an ADAM (AD) server with the following specs:</p> <p align=left>* Windows Server 2003 Standard Edition R2 (5.2.3790)</p> <p align=left> </p> <p align=left>To remove any COM+ complexity, I have created a simple .Net Windows application to test the ADAM calls.</p> <p align=left> </p> <p align=left>When I call ResetPassword from my XP SP2 machine, it works as does the test from another Windows Server 2003 R2 machine on the domain.</p> <p align=left> </p> <p align=left>When I move the same binary to the Windows 2000 box, the ResetPassword call DOES NOT work. I have another method called IsValid that takes in a user id and password and validates it in ADAM. IsValid WORKS on the Windows 2000 box.</p> <p align=left> </p> <p align=left>I raised a call with a Microsoft representative and they have been able to replicate this issue on their environments.</p> <p align=left> </p> <p align=left>After debugging code, I have observed that the bind to ADAM works. It only breaks when ResetPassword is called and only from Windows 2000.</p> <p align=left> </p> <p align=left>I have spent close to a week going to and fro with Microsoft and still do not have a resolution. </p> <p align=left>I think it could be one of the following:</p> <p align=left>- A bug with .Net framework 1.1 on Windows 2000 </p> <p align=left>- Incorrect code on my part</p> <p align=left>- Incorrect setup of ADAM</p> <p align=left> </p> <p align=left>Here why I think it may be a Microsoft bug:</p> <p align=left>- the code WORKS from other non-Windows 2000 machines</p> <p align=left>- I am using AD PwdReset code from MSDN (<span style="font-size:11pt;line-height:115%;font-family:'Calibri','sans-serif'"><a title="http://msdn.microsoft.com/en-us/library/aa772136.aspx" href="http://msdn.microsoft.com/en-us/library/aa772136.aspx"><font color="#800080">http://msdn.microsoft.com/en-us/library/aa772136.aspx</font></a></span>) which has been verified by Microsoft (with a minor tweak, see code below where the invoke arguments are explicitly cast to object)</p> <p align=left> </p> <p align=left>=========================================================================</p> <p>Here is the ResetPassword code:</p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;color:blue;font-family:'Courier New'"> <div class=codeseg> <div class=codecontent> <div class=codesniptitle><span style="width:100%">Code Snippet</span></div> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;color:blue;font-family:'Courier New'">public</span><span style="font-size:6.5pt;font-family:'Courier New'"> Response ResetPassword(User user, <span style="color:blue">string</span> newPassword, <span style="color:blue">bool</span> useSSL) {</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">Response response;</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;color:blue;font-family:'Courier New'">try</span><span style="font-size:6.5pt;font-family:'Courier New'"> {</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">AuthenticationTypes authTypes = (useSSL ? (AuthenticationTypes.None |<span> </span>AuthenticationTypes.SecureSocketsLayer) :<span>  </span>(AuthenticationTypes.None));</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"></span> </p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span>  </span>Trace.WriteLine(&quot;===============================================================&quot;);</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span>  </span>Trace.WriteLine(<span style="color:blue">string</span>.Format(&quot;Authentication format is : {0}&quot;, authTypes.ToString()));</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span>  </span>Trace.WriteLine(&quot;===============================================================&quot;);</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span>  </span>Trace.Flush();</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"></span> </p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;color:green;font-family:'Courier New'"><span>  </span>// Bind to user object using LDAP port.</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;color:green;font-family:'Courier New'"><span>  </span>// GetOrgUrl = <a>LDAP://m01:50008/CN=Users,CN=org1</a></span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;color:blue;font-family:'Courier New'"><span>  </span>using</span><span style="font-size:6.5pt;font-family:'Courier New'"> (DirectoryEntry entry = <span style="color:blue">new</span> DirectoryEntry(GetOrgUrl(useSSL), </span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span>  </span><span>                 </span><span>   </span>_adminUser, _adminPwd, authTypes)) {<span>                   </span><span>                                                </span></span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span>                                                </span></span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span> </span>Trace.WriteLine(&quot;===============================================================&quot;);</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">Trace.WriteLine(<span style="color:blue">string</span>.Format(&quot;LDAP Top Level Path for ResetPasswod (SSL) function is: {0}&quot;, OrgUrl(useSSL)));</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span> </span>Trace.WriteLine(&quot;===============================================================&quot;);</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span> </span>Trace.Flush();</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span> </span>entry.RefreshCache();</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span>                                                </span></span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span> </span>Trace.WriteLine(&quot;===============================================================&quot;);</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span> </span>Trace.WriteLine(<span style="color:blue">string</span>.Format(&quot;Successfully bound to: {0}&quot;, GetOrgUrl(useSSL)));</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span> </span>Trace.WriteLine(&quot;===============================================================&quot;);</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span> </span>Trace.Flush();</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"></span> </p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;color:green;font-family:'Courier New'">/* Find the user */</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;color:blue;font-family:'Courier New'">using</span><span style="font-size:6.5pt;font-family:'Courier New'"> (DirectorySearcher ds = <span style="color:blue">new</span> DirectorySearcher(entry)) {</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">ds.SearchScope = SearchScope.Subtree;</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">ds.Filter = &quot;(&amp;(objectclass=*)(cn= &quot; + user.UserName + &quot;))&quot;;</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">SearchResult sr;<span>                                          </span></span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">sr = ds.FindOne();</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;color:blue;font-family:'Courier New'">if</span><span style="font-size:6.5pt;font-family:'Courier New'"> (sr != <span style="color:blue">null</span>) {</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;color:blue;font-family:'Courier New'">using</span><span style="font-size:6.5pt;font-family:'Courier New'"> (DirectoryEntry de = <span style="color:blue">new</span> DirectoryEntry(sr.Path, _adminUser, _adminPwd, authTypes)) {</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"></span> </p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span> </span>Trace.WriteLine(&quot;===============================================================&quot;);</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span> </span>Trace.WriteLine(<span style="color:blue">string</span>.Format(&quot;Binding to user path: {0} using authentication type: {1}&quot;, </span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span>                                                                   </span>sr.Path, authTypes));</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span> </span>Trace.WriteLine(&quot;===============================================================&quot;);</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span> </span>Trace.Flush();</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"></span> </p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span> </span>de.RefreshCache();</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"></span> </p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span> </span>Trace.WriteLine(&quot;===============================================================&quot;);</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span> </span>Trace.WriteLine(&quot;Invoking ResetPassword ...&quot;);</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span> </span>Trace.WriteLine(&quot;===============================================================&quot;);</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span> </span>Trace.Flush();</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"></span> </p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;color:green;font-family:'Courier New'">//Reset password throws an exception here while running on Windows Server 2000</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">de.Invoke(&quot;SetOption&quot;, <span style="color:blue">new</span> <span style="color:blue">object</span>[] {(<span style="color:blue">int</span>)ADS_OPTION_PASSWORD_PORTNUMBER, (<span style="color:blue">object</span>)_portNo });<span>                                                   </span><span>                   </span></span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">de.Invoke(&quot;SetOption&quot;, <span style="color:blue">new</span> <span style="color:blue">object</span>[] { (<span style="color:blue">int</span>)ADS_OPTION_PASSWORD_METHOD, (<span style="color:blue">object</span>)ADS_PASSWORD_ENCODE_CLEAR});<span>                                     </span><span>                                      </span></span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">de.Invoke(&quot;SetPassword&quot;, <span style="color:blue">new</span> <span style="color:blue">object</span>[] {newPassword});<span>                                                                        </span></span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"></span> </p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">response = <span style="color:blue">new</span> Response();</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">response.IsSuccess = <span style="color:blue">true</span>;</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">response.Data = &quot;TRUE&quot;;<span>                         </span></span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">}}</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;color:blue;font-family:'Courier New'">else</span><span style="font-size:6.5pt;font-family:'Courier New'"> {</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">Trace.WriteLine(&quot;=======================================================================&quot;);</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">Trace.WriteLine(<span style="color:blue">string</span>.Format(&quot;User {0} not found&quot;, user.UserName));</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">Trace.WriteLine(&quot;=======================================================================&quot;);</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">Trace.Flush();</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">response = <span style="color:blue">new</span> Response();</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">response.IsSuccess = <span style="color:blue">false</span>;</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">response.FriendlyMessage = <span style="color:blue">string</span>.Format(&quot;ResetPassword call failed for user {0}&quot;, user.UserName);</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">response.Message = <span style="color:blue">string</span>.Format(&quot;User {0} does not exist.&quot;, user.UserName);</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">response.Data = &quot;FALSE&quot;;</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span>                                                          </span>}}}}</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;color:blue;font-family:'Courier New'">catch</span><span style="font-size:6.5pt;font-family:'Courier New'"> (System.Reflection.TargetInvocationException tEx) {</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span>  </span>response = GetError(tEx);</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span>  </span>response.FriendlyMessage = <span style="color:blue">string</span>.Format(&quot;ResetPassword call failed for user {0}&quot;, user.UserName);</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span>  </span>response.Data = &quot;FALSE&quot;;</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">}</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;color:blue;font-family:'Courier New'">catch</span><span style="font-size:6.5pt;font-family:'Courier New'"> (Exception ex) { </span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">response = GetError(ex);</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">response.FriendlyMessage = <span style="color:blue">string</span>.Format(&quot;ResetPassword call failed for user {0}&quot;, user.UserName);</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">response.Data = &quot;FALSE&quot;; }</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;color:blue;font-family:'Courier New'">return</span><span style="font-size:6.5pt;font-family:'Courier New'"> response; }</span></p> <p align=left> </p></div></div> <p align=left> </p></span> <p></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:6.5pt;line-height:115%"><font face=Calibri></font></span> </p> <p align=left>Here is the error message that I get:</p> <p align=left> </p> <div style="border-right:medium none;padding-right:0cm;border-top:medium none;padding-left:0cm;padding-bottom:1pt;border-left:medium none;padding-top:0cm;border-bottom:windowtext 2.25pt double;mso-element:para-border-div"> <p class=MsoNormal style="border-right:medium none;padding-right:0cm;border-top:medium none;padding-left:0cm;padding-bottom:0cm;margin:0cm 0cm 10pt;border-left:medium none;padding-top:0cm;border-bottom:medium none"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000">ResetPasswordNonSSL() called.</font></font></span></p></div> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000">Response</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000">===========</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000">IsSuccess: False</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000">Data: FALSE</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000">Friendly Message:ResetPassword call failed for user user1</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000"><span> </span>Message: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---&gt; System.Runtime.InteropServices.COMException (0x80005008): Exception from HRESULT: 0x80005008.</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000"><span>   </span>--- End of inner exception stack trace ---</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000"><span>   </span>at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000"><span>   </span>at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters)</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000"><span>   </span>at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args)</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000"><span>   </span>at System.DirectoryServices.DirectoryEntry.Invoke(String methodName, Object[] args)</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000"><span>   </span>at ADAM.ADAMHelper.ResetPassword(User user, String newPassword, Boolean useSSL)</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000">Stack Trace:<span>   </span>at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000"><span>   </span>at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters)</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000"><span>   </span>at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args)</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000"><span>   </span>at System.DirectoryServices.DirectoryEntry.Invoke(String methodName, Object[] args)</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000"><span>   </span>at ADAM.ADAMHelper.ResetPassword(User user, String newPassword, Boolean useSSL)</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000">======================================================================================</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000">Authentication format is : None</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000">======================================================================================</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff" color="#ff0000">LDAP Top Level Path for ResetPasswod (SSL) function is: </font><a><font style="background-color:#ffffff" color="#ff0000">LDAP://m01:50008/CN=Users,CN=org1</font></a></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000">======================================================================================</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000">======================================================================================</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff" color="#ff0000">Successfully bound to: </font><a><font style="background-color:#ffffff" color="#ff0000">LDAP://m01:50008/CN=Users,CN=org1</font></a></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000">======================================================================================</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000">======================================================================================</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff" color="#ff0000">Binding to user path: </font><a><font style="background-color:#ffffff" color="#ff0000">LDAP://m01:50008/CN=user1,CN=Users,CN=org1</font></a><font style="background-color:#ffffff"><font color="#ff0000"> using authentication type: None</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000">======================================================================================</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000">======================================================================================</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000">Invoking ResetPassword ...</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><font style="background-color:#ffffff"><font color="#ff0000"><i><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'">======================================================================================</span></i><span style="font-size:8pt;line-height:115%;font-family:'Gill Sans MT','sans-serif'"></span></font></font></p> <p align=left><br> </p> <p align=left> </p> <p></p>© 2009 Microsoft Corporation. All rights reserved.Thu, 11 Dec 2008 01:38:50 Zbb518eb3-02cb-4b3c-9a18-4ce85f245131http://social.technet.microsoft.com/Forums/en-US/exchangesvrdevelopment/thread/bb518eb3-02cb-4b3c-9a18-4ce85f245131#bb518eb3-02cb-4b3c-9a18-4ce85f245131http://social.technet.microsoft.com/Forums/en-US/exchangesvrdevelopment/thread/bb518eb3-02cb-4b3c-9a18-4ce85f245131#bb518eb3-02cb-4b3c-9a18-4ce85f245131Shailen Sukulhttp://social.technet.microsoft.com/Profile/en-US/?user=Shailen%20SukulActive Directory (ADAM) on Windows Server 2000 SP4 .Net 1.1 does not work<p align=left>I am working for a large banking client who have older infrastructure in the Application services layer.</p> <p align=left> </p> <p align=left>I have created a COM+ component that resides in an Application server with the following specs:</p> <p align=left>* Windows Server 2000 SP4</p> <p align=left>* .Net Framework 1.1</p> <p align=left>* has its own workgroup</p> <p align=left> </p> <p align=left>This component communicates to an ADAM (AD) server with the following specs:</p> <p align=left>* Windows Server 2003 Standard Edition R2 (5.2.3790)</p> <p align=left> </p> <p align=left>To remove any COM+ complexity, I have created a simple .Net Windows application to test the ADAM calls.</p> <p align=left> </p> <p align=left>When I call ResetPassword from my XP SP2 machine, it works as does the test from another Windows Server 2003 R2 machine on the domain.</p> <p align=left> </p> <p align=left>When I move the same binary to the Windows 2000 box, the ResetPassword call DOES NOT work. I have another method called IsValid that takes in a user id and password and validates it in ADAM. IsValid WORKS on the Windows 2000 box.</p> <p align=left> </p> <p align=left>I raised a call with a Microsoft representative and they have been able to replicate this issue on their environments.</p> <p align=left> </p> <p align=left>After debugging code, I have observed that the bind to ADAM works. It only breaks when ResetPassword is called and only from Windows 2000.</p> <p align=left> </p> <p align=left>I have spent close to a week going to and fro with Microsoft and still do not have a resolution. </p> <p align=left>I think it could be one of the following:</p> <p align=left>- A bug with .Net framework 1.1 on Windows 2000 </p> <p align=left>- Incorrect code on my part</p> <p align=left>- Incorrect setup of ADAM</p> <p align=left> </p> <p align=left>Here why I think it may be a Microsoft bug:</p> <p align=left>- the code WORKS from other non-Windows 2000 machines</p> <p align=left>- I am using AD PwdReset code from MSDN (<span style="font-size:11pt;line-height:115%;font-family:'Calibri','sans-serif'"><a title="http://msdn.microsoft.com/en-us/library/aa772136.aspx" href="http://msdn.microsoft.com/en-us/library/aa772136.aspx"><font color="#800080">http://msdn.microsoft.com/en-us/library/aa772136.aspx</font></a></span>) which has been verified by Microsoft (with a minor tweak, see code below where the invoke arguments are explicitly cast to object)</p> <p align=left> </p> <p align=left>=========================================================================</p> <p>Here is the ResetPassword code:</p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;color:blue;font-family:'Courier New'"> <div class=codeseg> <div class=codecontent> <div class=codesniptitle><span style="width:100%">Code Snippet</span></div> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;color:blue;font-family:'Courier New'">public</span><span style="font-size:6.5pt;font-family:'Courier New'"> Response ResetPassword(User user, <span style="color:blue">string</span> newPassword, <span style="color:blue">bool</span> useSSL) {</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">Response response;</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;color:blue;font-family:'Courier New'">try</span><span style="font-size:6.5pt;font-family:'Courier New'"> {</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">AuthenticationTypes authTypes = (useSSL ? (AuthenticationTypes.None |<span> </span>AuthenticationTypes.SecureSocketsLayer) :<span>  </span>(AuthenticationTypes.None));</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"></span> </p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span>  </span>Trace.WriteLine(&quot;===============================================================&quot;);</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span>  </span>Trace.WriteLine(<span style="color:blue">string</span>.Format(&quot;Authentication format is : {0}&quot;, authTypes.ToString()));</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span>  </span>Trace.WriteLine(&quot;===============================================================&quot;);</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span>  </span>Trace.Flush();</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"></span> </p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;color:green;font-family:'Courier New'"><span>  </span>// Bind to user object using LDAP port.</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;color:green;font-family:'Courier New'"><span>  </span>// GetOrgUrl = <a>LDAP://m01:50008/CN=Users,CN=org1</a></span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;color:blue;font-family:'Courier New'"><span>  </span>using</span><span style="font-size:6.5pt;font-family:'Courier New'"> (DirectoryEntry entry = <span style="color:blue">new</span> DirectoryEntry(GetOrgUrl(useSSL), </span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span>  </span><span>                 </span><span>   </span>_adminUser, _adminPwd, authTypes)) {<span>                   </span><span>                                                </span></span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span>                                                </span></span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span> </span>Trace.WriteLine(&quot;===============================================================&quot;);</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">Trace.WriteLine(<span style="color:blue">string</span>.Format(&quot;LDAP Top Level Path for ResetPasswod (SSL) function is: {0}&quot;, OrgUrl(useSSL)));</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span> </span>Trace.WriteLine(&quot;===============================================================&quot;);</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span> </span>Trace.Flush();</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span> </span>entry.RefreshCache();</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span>                                                </span></span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span> </span>Trace.WriteLine(&quot;===============================================================&quot;);</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span> </span>Trace.WriteLine(<span style="color:blue">string</span>.Format(&quot;Successfully bound to: {0}&quot;, GetOrgUrl(useSSL)));</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span> </span>Trace.WriteLine(&quot;===============================================================&quot;);</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span> </span>Trace.Flush();</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"></span> </p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;color:green;font-family:'Courier New'">/* Find the user */</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;color:blue;font-family:'Courier New'">using</span><span style="font-size:6.5pt;font-family:'Courier New'"> (DirectorySearcher ds = <span style="color:blue">new</span> DirectorySearcher(entry)) {</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">ds.SearchScope = SearchScope.Subtree;</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">ds.Filter = &quot;(&amp;(objectclass=*)(cn= &quot; + user.UserName + &quot;))&quot;;</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">SearchResult sr;<span>                                          </span></span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">sr = ds.FindOne();</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;color:blue;font-family:'Courier New'">if</span><span style="font-size:6.5pt;font-family:'Courier New'"> (sr != <span style="color:blue">null</span>) {</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;color:blue;font-family:'Courier New'">using</span><span style="font-size:6.5pt;font-family:'Courier New'"> (DirectoryEntry de = <span style="color:blue">new</span> DirectoryEntry(sr.Path, _adminUser, _adminPwd, authTypes)) {</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"></span> </p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span> </span>Trace.WriteLine(&quot;===============================================================&quot;);</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span> </span>Trace.WriteLine(<span style="color:blue">string</span>.Format(&quot;Binding to user path: {0} using authentication type: {1}&quot;, </span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span>                                                                   </span>sr.Path, authTypes));</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span> </span>Trace.WriteLine(&quot;===============================================================&quot;);</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span> </span>Trace.Flush();</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"></span> </p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span> </span>de.RefreshCache();</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"></span> </p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span> </span>Trace.WriteLine(&quot;===============================================================&quot;);</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span> </span>Trace.WriteLine(&quot;Invoking ResetPassword ...&quot;);</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span> </span>Trace.WriteLine(&quot;===============================================================&quot;);</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span> </span>Trace.Flush();</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"></span> </p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;color:green;font-family:'Courier New'">//Reset password throws an exception here while running on Windows Server 2000</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">de.Invoke(&quot;SetOption&quot;, <span style="color:blue">new</span> <span style="color:blue">object</span>[] {(<span style="color:blue">int</span>)ADS_OPTION_PASSWORD_PORTNUMBER, (<span style="color:blue">object</span>)_portNo });<span>                                                   </span><span>                   </span></span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">de.Invoke(&quot;SetOption&quot;, <span style="color:blue">new</span> <span style="color:blue">object</span>[] { (<span style="color:blue">int</span>)ADS_OPTION_PASSWORD_METHOD, (<span style="color:blue">object</span>)ADS_PASSWORD_ENCODE_CLEAR});<span>                                     </span><span>                                      </span></span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">de.Invoke(&quot;SetPassword&quot;, <span style="color:blue">new</span> <span style="color:blue">object</span>[] {newPassword});<span>                                                                        </span></span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"></span> </p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">response = <span style="color:blue">new</span> Response();</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">response.IsSuccess = <span style="color:blue">true</span>;</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">response.Data = &quot;TRUE&quot;;<span>                         </span></span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">}}</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;color:blue;font-family:'Courier New'">else</span><span style="font-size:6.5pt;font-family:'Courier New'"> {</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">Trace.WriteLine(&quot;=======================================================================&quot;);</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">Trace.WriteLine(<span style="color:blue">string</span>.Format(&quot;User {0} not found&quot;, user.UserName));</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">Trace.WriteLine(&quot;=======================================================================&quot;);</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">Trace.Flush();</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">response = <span style="color:blue">new</span> Response();</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">response.IsSuccess = <span style="color:blue">false</span>;</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">response.FriendlyMessage = <span style="color:blue">string</span>.Format(&quot;ResetPassword call failed for user {0}&quot;, user.UserName);</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">response.Message = <span style="color:blue">string</span>.Format(&quot;User {0} does not exist.&quot;, user.UserName);</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">response.Data = &quot;FALSE&quot;;</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span>                                                          </span>}}}}</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;color:blue;font-family:'Courier New'">catch</span><span style="font-size:6.5pt;font-family:'Courier New'"> (System.Reflection.TargetInvocationException tEx) {</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span>  </span>response = GetError(tEx);</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span>  </span>response.FriendlyMessage = <span style="color:blue">string</span>.Format(&quot;ResetPassword call failed for user {0}&quot;, user.UserName);</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"><span>  </span>response.Data = &quot;FALSE&quot;;</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">}</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;color:blue;font-family:'Courier New'">catch</span><span style="font-size:6.5pt;font-family:'Courier New'"> (Exception ex) { </span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">response = GetError(ex);</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">response.FriendlyMessage = <span style="color:blue">string</span>.Format(&quot;ResetPassword call failed for user {0}&quot;, user.UserName);</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'">response.Data = &quot;FALSE&quot;; }</span></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;color:blue;font-family:'Courier New'">return</span><span style="font-size:6.5pt;font-family:'Courier New'"> response; }</span></p> <p align=left> </p></div></div> <p align=left> </p></span> <p></p> <p class=MsoNormal style="margin:0cm 0cm 0pt;line-height:normal" align=left><span style="font-size:6.5pt;font-family:'Courier New'"></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:6.5pt;line-height:115%"><font face=Calibri></font></span> </p> <p align=left>Here is the error message that I get:</p> <p align=left> </p> <div style="border-right:medium none;padding-right:0cm;border-top:medium none;padding-left:0cm;padding-bottom:1pt;border-left:medium none;padding-top:0cm;border-bottom:windowtext 2.25pt double;mso-element:para-border-div"> <p class=MsoNormal style="border-right:medium none;padding-right:0cm;border-top:medium none;padding-left:0cm;padding-bottom:0cm;margin:0cm 0cm 10pt;border-left:medium none;padding-top:0cm;border-bottom:medium none"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000">ResetPasswordNonSSL() called.</font></font></span></p></div> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000">Response</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000">===========</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000">IsSuccess: False</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000">Data: FALSE</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000">Friendly Message:ResetPassword call failed for user user1</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000"><span> </span>Message: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---&gt; System.Runtime.InteropServices.COMException (0x80005008): Exception from HRESULT: 0x80005008.</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000"><span>   </span>--- End of inner exception stack trace ---</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000"><span>   </span>at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000"><span>   </span>at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters)</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000"><span>   </span>at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args)</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000"><span>   </span>at System.DirectoryServices.DirectoryEntry.Invoke(String methodName, Object[] args)</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000"><span>   </span>at ADAM.ADAMHelper.ResetPassword(User user, String newPassword, Boolean useSSL)</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000">Stack Trace:<span>   </span>at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000"><span>   </span>at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters)</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000"><span>   </span>at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args)</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000"><span>   </span>at System.DirectoryServices.DirectoryEntry.Invoke(String methodName, Object[] args)</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000"><span>   </span>at ADAM.ADAMHelper.ResetPassword(User user, String newPassword, Boolean useSSL)</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000">======================================================================================</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000">Authentication format is : None</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000">======================================================================================</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff" color="#ff0000">LDAP Top Level Path for ResetPasswod (SSL) function is: </font><a><font style="background-color:#ffffff" color="#ff0000">LDAP://m01:50008/CN=Users,CN=org1</font></a></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000">======================================================================================</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000">======================================================================================</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff" color="#ff0000">Successfully bound to: </font><a><font style="background-color:#ffffff" color="#ff0000">LDAP://m01:50008/CN=Users,CN=org1</font></a></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000">======================================================================================</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000">======================================================================================</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff" color="#ff0000">Binding to user path: </font><a><font style="background-color:#ffffff" color="#ff0000">LDAP://m01:50008/CN=user1,CN=Users,CN=org1</font></a><font style="background-color:#ffffff"><font color="#ff0000"> using authentication type: None</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000">======================================================================================</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000">======================================================================================</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'"><font style="background-color:#ffffff"><font color="#ff0000">Invoking ResetPassword ...</font></font></span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><font style="background-color:#ffffff"><font color="#ff0000"><i><span style="font-size:8pt;color:gray;line-height:115%;font-family:'Gill Sans MT','sans-serif'">======================================================================================</span></i><span style="font-size:8pt;line-height:115%;font-family:'Gill Sans MT','sans-serif'"></span></font></font></p> <p align=left><br> </p> <p align=left> </p> <p></p>Mon, 20 Oct 2008 02:51:26 Z2008-10-20T05:42:39Zhttp://social.technet.microsoft.com/Forums/en-US/exchangesvrdevelopment/thread/bb518eb3-02cb-4b3c-9a18-4ce85f245131#7c9a4e23-6a8b-4d3b-8011-e3f90e70809ahttp://social.technet.microsoft.com/Forums/en-US/exchangesvrdevelopment/thread/bb518eb3-02cb-4b3c-9a18-4ce85f245131#7c9a4e23-6a8b-4d3b-8011-e3f90e70809aShailen Sukulhttp://social.technet.microsoft.com/Profile/en-US/?user=Shailen%20SukulActive Directory (ADAM) on Windows Server 2000 SP4 .Net 1.1 does not work<p align=left><font face=Arial size=2></font> </p> <p>This issue has been resolved !!!</p> <p align=left> </p> <p align=left>I had to apply a Hotfix on the Windows 2000 machine that was calling ADAM.</p> <p align=left> </p> <p align=left>See this url: <font face=Calibri color="#0000ff" size=3></p> <p><a title="http://support.microsoft.com/kb/817583" href="http://support.microsoft.com/kb/817583">http://support.microsoft.com/kb/817583</a></p> <p> </p> <p align=left><font color="#000000">The principal cause was the following:</font></p> <p align=left>&quot;This problem occurs because ADSI is restricted to SSL port number 636 when it makes a bind call to the LDAP server.&quot;</font></p>Mon, 20 Oct 2008 05:42:28 Z2008-10-20T05:42:39Z