We've had LDAP working for 3 years from a computer that was on the domain and from one that was not. We moved the one that was not into the computer groups for that domain (we joined the domain). We have 3 domains only the mother domain is able to be successfully contacted for LDAP lookups. The satellite domains give this error: System.Runtime.InteropServices.COMException (0x8007052E): Logon failure: unknown user name or bad password. at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) at System.DirectoryServices.DirectoryEntry.Bind() at System.DirectoryServices.DirectoryEntry.get_AdsObject() at System.DirectoryServices.DirectorySearcher.FindAll(Boolean findMoreThanOne) at System.DirectoryServices.DirectorySearcher.FindOne()
Here is the code that is giving me this hard time in vb.net: keep in mind this used to all work before the past weekend. This question is worth 500 points.
Dim Entry As New System.DirectoryServices.DirectoryEntry("LDAP://" & tbLdapServer.Text, tbUserName.Text, tbPassword.Text)
Entry.AuthenticationType = DirectoryServices.AuthenticationTypes.None
Dim Searcher As New System.DirectoryServices.DirectorySearcher(Entry)
Searcher.Filter = "(SAMAccountName=" & tbDomainName.Text & tbUserName.Text & ")"
Dim Result As System.DirectoryServices.SearchResult = Nothing
Result = Searcher.FindOne
lblTextUserNameAndPasswordResults.Text = "Success:" & Result.Path
Catch ex As Exception
Dim exString As String = ex.ToString
While Not ex.InnerException Is Nothing
exString += ex.InnerException.ToString
ex = ex.InnerException
lblTextUserNameAndPasswordResults.Text = exString
I've tried running this code every which way, I am using the log in users username and password to check their authentication. It crashes at the FineOne line.