active directory - LDAP query for all users in sub OUs within a particular OU -


I have to clear an active directory such that there are many OUs in the domain. One of these OUs is named "Primary OU" There are several OUs within the OU, whose name is in place of global offices (i.e. "Chicago" "Paris").

Any user account which is a real meat and bone person, is put in the OU, whose name is in the form of his primary OU. The "Primary OU" OU is set as their primary OU in any user account that is not connected to the aliases, generic accounts, or otherwise directly to any real person.

Data-wise, this primary OU difference is the only thing that shows which users are real people and which users are not. There is no group in which only real people, there is no indication in any area whether they are real people or not, and any change in active directory or any user account is strictly prohibited.

My job query that will only be found by people of all real flesh and bones.

Unfortunately, LDAP is not my strong suit at all and the way I came, it is searching for all these sub-oUs individually and all together, but there are many offices and if If an office has been added, it will require a change in the query, which I need to avoid.

Does the "sub" OUs of a particular OU, but parents do not return directly to any user in the OU?

Yes, surely - you

1) special oU

< Pre> Join directory myOU = New directoryInterity ("LDAP: // OU = MyUU, ......, DC = MyCompany, DC = com");

2) Nominate all your sub-AUs

  directory finder subOUsearcher = new directory finder (myOU); SubOUsearcher.SearchScope = SearchScope.OneLevel; // subOUsearcher.Filter = "(Object Class = Organizational Unit)" does not repair; {SearchResult subOU} {// stick to all those OUs in a list and then handle them) in Foreach (subousearcher.FindAll ())  

3) One by one Users can count the sub-oU and paste them into the global list of users.

  Directory Finder User Finder = New Directory Finder (myCurrentSubOu); User Finder SearchScope = SearchScope .Onvalav; // Do not free user explorers. Filter = "(object class = user)";  

4) Return to that list

Mark


Comments

Popular posts from this blog

c++ - Linux and clipboard -

Visual Studio 2005: How to speed up builds when a VSMDI is open? -

booting ubuntu from usb using virtualbox -