FishmanTobin
asked on
LDAP Suddenly Stopped Working
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.InteropServ ices.COMEx ception (0x8007052E): Logon failure: unknown user name or bad password. at System.DirectoryServices.D irectoryEn try.Bind(B oolean throwIfFail) at System.DirectoryServices.D irectoryEn try.Bind() at System.DirectoryServices.D irectoryEn try.get_Ad sObject() at System.DirectoryServices.D irectorySe archer.Fin dAll(Boole an findMoreThanOne) at System.DirectoryServices.D irectorySe archer.Fin dOne()
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.D irectoryEn try("LDAP: //" & tbLdapServer.Text, tbUserName.Text, tbPassword.Text)
Entry.AuthenticationType = DirectoryServices.Authenti cationType s.None
Dim Searcher As New System.DirectoryServices.D irectorySe archer(Ent ry)
Searcher.Filter = "(SAMAccountName=" & tbDomainName.Text & tbUserName.Text & ")"
Searcher.PropertiesToLoad. Add("cn")
Dim Result As System.DirectoryServices.S earchResul t = Nothing
Try
Result = Searcher.FindOne
lblTextUserNameAndPassword Results.Te xt = "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
End While
lblTextUserNameAndPassword Results.Te xt = exString
End Try
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.
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.D
Entry.AuthenticationType = DirectoryServices.Authenti
Dim Searcher As New System.DirectoryServices.D
Searcher.Filter = "(SAMAccountName=" & tbDomainName.Text & tbUserName.Text & ")"
Searcher.PropertiesToLoad.
Dim Result As System.DirectoryServices.S
Try
Result = Searcher.FindOne
lblTextUserNameAndPassword
Catch ex As Exception
Dim exString As String = ex.ToString
While Not ex.InnerException Is Nothing
exString += ex.InnerException.ToString
ex = ex.InnerException
End While
lblTextUserNameAndPassword
End Try
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.
ASKER
After more trial an error based on your suggestions, I've got it partially working and the problem becomes a little clearer. Ok, I have Domain A, B, C . B & C Trust A, I can use a user from Domain A as the LDAP user name and password to look up a user that exists only on Domain B or C. The way it worked before things failed was I would pass Domain B info to Domain B a Domain B user name and password for users only on that domain. So what is happening now is I can look up users on Domain B but I have to use a Domain A user account to get LDAP connectivity. Why is this happening and how can we fix that?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
There we not sufficient comments on this and we solved it ourselves.
Also check the permissions that you have on the machine since adding it to the domain. Which LDAP Server are you using? Have you looked at the documentation for similar scenarios and what to expect.