0

Is there's any way to check if the username and password exist in Active Directory using VB.NET?

R. Moawad
  • 3
  • 3
  • http://www.codeproject.com/Articles/19689/Working-with-Active-Directory-in-VB-NET this is probably the best article regarding this matter – GrindelOh Jan 22 '16 at 14:36
  • Duplicate of: http://stackoverflow.com/questions/12722407/check-if-user-exists-in-active-directory – Matt Wilko Jan 22 '16 at 14:48

1 Answers1

1

You can leverage the PrincipalContext Class' ValidateCredentials Method:

Dim objPrincipalContext As New System.DirectoryServices.AccountManagement.PrincipalContext(ContextType.Domain, "YourDomain")

Dim bolIsAuthenticated As Boolean = objPrincipalContext.ValidateCredentials("UserName", "Password")
NoAlias
  • 9,218
  • 2
  • 27
  • 46