Format:
Recent snippets matching tags of Active Directory
public bool IsADUsernameExistsAndNotDisabled(string userName) { DirectoryEntry searchRoot = new DirectoryEntry(ldapConnection, eCrewUserName, eCrewUserPassword); DirectoryEntry searchRoot = new DirectoryEntry("LDAP://999.999.999.999/DC=CompanyDomain, DC=com", "ADUserAdmin", "AdUserAdminPassword"); DirectorySearcher searchForUser = new DirectorySearcher(searchRoot); searchForUser.SearchScope = SearchScope.Subtree; //searchForUser.Filter = string.Format("(&(objectCategory=Person)(anr={0}))", userName); //searchForUser.Filter = string.Format("(&(objectCategory=Person)(anr={0})(userAccountControl:1.2.840.113556.1.4.803:=2))", userName);
208 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
