Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- my code
- -------
- Public Function AuthenticateUser(ByVal ldapServerName As String, ByVal username As String, ByVal password As String) As Boolean
- Dim ou_ As String = "sunbs.in"
- Dim _ldapServerName = ldapServerName
- Dim oRoot As DirectoryEntry = New DirectoryEntry("LDAP://" & ldapServerName &
- "/uid=""" & username & """,ou= ou_", "uid=""" & username & """,ou= ou_", password, AuthenticationTypes.ServerBind)
- Dim oSearcher As DirectorySearcher = New DirectorySearcher(oRoot)
- Try
- Dim mySearchResult As SearchResult = oSearcher.FindOne()
- Return True
- Catch e As Exception
- MsgBox("Error is " & e.Message)
- Return False
- End Try
- End Function
Add Comment
Please, Sign In to add comment