PrincipalContext context = new PrincipalContext(ContextType.Domain); bool isValid = context.ValidateCredentials(userName, password);