August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!
function AuthenticateUser(UserName, Password, Domain) dim strUser ' assume failure AuthenticateUser = false strUser = UserName strPassword = Password 'response.write(UserName&"---"&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
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.