title: "The user name or password is incorrect" error on running ASP.NET Web Application
body: <p>I'm trying to run an ASP.NET Web App, but keep getting</p>
  <blockquote>
  <p><code>System.DirectoryServices.DirectoryServicesCOMException</code>: The user name or password is incorrect</p>
  </blockquote>
  <p>I've tried to change Application Pool Identity, according to solution found <a href="https://stackoverflow.com/questions/13688031/system-directoryservices-directoryservicescomexception-an-operations-error-occu">here</a>, but nothing changes.</p>
  <p><strong>Source error (line 15):</strong></p>
  <pre class="lang-cs prettyprint-override"><code>Line 10: dim LDAP as String = System.Web.Configuration.WebConfigurationManager.AppSettings(&quot;LDAP&quot;)
  Line 11: Dim sAMAccountName As String = userName.Substring(userName.IndexOf(''\'') + 1)
  Line 12: Dim de As System.DirectoryServices.DirectoryEntry = New System.DirectoryServices.DirectoryEntry(LDAP)
  Line 13: Dim ds As System.DirectoryServices.DirectorySearcher = New System.DirectoryServices.DirectorySearcher(de)
  Line 14: ds.Filter = &quot;(&amp;(objectClass=User)(sAMAccountName=&quot; &amp; sAMAccountName &amp; &quot;))&quot;
  Line 15: Dim result As System.DirectoryServices.SearchResult = ds.FindOne()
  Line 16: dim qq=result.Properties(&quot;memberOf&quot;)
  Line 17: dim sid=BitConverter.ToString(result.Properties(&quot;objectSID&quot;)(0))
  </code></pre>
  <p><strong>Stack trace:</strong></p>
  <pre><code>[DirectoryServicesCOMException (0x8007052e): The user name or password is incorrect.
  ]
     System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) +399099
     System.DirectoryServices.DirectoryEntry.Bind() +36
     System.DirectoryServices.DirectoryEntry.get_AdsObject() +31
     System.DirectoryServices.DirectorySearcher.FindAll(Boolean findMoreThanOne) +78
     System.DirectoryServices.DirectorySearcher.FindOne() +39
     ASP.default_aspx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in D:\..\:15
     System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +268
     System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +13
     System.Web.UI.Page.Render(HtmlTextWriter writer) +29
     System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +66
     System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
     System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
     System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1303
  </code></pre>