function AuthenticateUser(UserName, Password, Domain) dim strUser ' assume failure AuthenticateUser = false strUser = UserName strPassword = Password strQuery = "SELECT cn FROM 'LDAP://" & Domain & "' WHERE objectClass='*' " set oConn = server.CreateObject("ADODB.Connection") oConn.Provider = "ADsDSOOBJECT" oConn.Properties("User ID") = strUser oConn.Properties("Password") = strPassword oConn.Properties("Encrypt Password") = true oConn.open "DS Query", strUser, strPassword set cmd = server.CreateObject("ADODB.Command") set cmd.ActiveConnection = oConn cmd.CommandText = strQuery on error resume next set oRS = cmd.Execute if oRS.bof or oRS.eof then AuthenticateUser = false else AuthenticateUser = true end if set oRS = nothing set oConn = nothing end function
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)