Answers for "ldap check user exists"

C#
1

ldap check user exists

public bool UserExists(string username)
{
   // create your domain context
   using (PrincipalContext domain = new PrincipalContext(ContextType.Domain))
   {
       // find the user
       UserPrincipal foundUser = UserPrincipal.FindByIdentity(domain, IdentityType.Name, username);

       return foundUser != null;
    }
}
Posted by: Guest on February-28-2022

Code answers related to "ldap check user exists"

C# Answers by Framework

Browse Popular Code Answers by Language