I am getting all the users in specific OUs from a C# code that I wrote. You may see the code below. And I would like to know what is the equivalent LDAP query that I need to make in the Active Directory Users and Computers (ADUC) User Interface (UI) to get the same results (see attached figure).
Thank you for helping. I am quite new with LDAP and Active Directories (AD) and I appreciate any help even if my question is stupid.
C# code:
myDirectoryEntry = new DirectoryEntry("LDAP://subdomain.domain.com/OU=firstou,OU=secondou,OU=thirdou,OU=forthou,OU=fifthou,OU=sixthou,DC=subdomain,DC=domain,DC=com");
myDirectorySearcher = new DirectorySearcher(myDirectoryEntry);
myDirectorySearcher.PageSize = 10000;
myDirectorySearcher.CacheResults = false;
myDirectorySearcher.Filter = "(objectCategory=user)";
myDirectorySearcher.SearchScope = SearchScope.Subtree;
SearchResultCollection result= myDirectorySearcher.FindAll();
What goes in the ADUC LLDAP filetr UI? Click here for a picture