directoryservices - Prevent subcontainer objects in PrincipalSearcher Query C# -
How can I stop subcontracting objects in a specific o with sub-concencer (child ou)?
To clarify, I do not want to include user objects in OU (subclass) children in the result object.
For example, something like code was given:
/ /Uriprint User = A key to describing // for the discovery of new user protec (adprinithcontact) Create an object presentation; // Define properties of search (this can use wildcards) user.Enabled = false; User.Name = "user *"; // Create a major finder for running search operations PrincipalSheller PS = New PrincipalStrategy (); // Assign query filter properties for the main object // You // can also create user principal in // PrincipalStrustor Constructor pS.QueryFilter = user; // Query Find Topics Search & lt; Principal & gt; Results = pS.FindAll (); Console.light line ("Inactive Accounts" starting with the user's name: "); Foreach (main result in result) {Console.WriteLine ("name: {0}", results .name); } Thanks,
Victor
Unfortunately, this (and some other) features are not directly visible on the PrincipalShetter class. To set options in this way you (and the page size like), underlying directory finder directory finder DS = pS.GetUnderlyingSearcher () As DirectorySearcher; If (DS! = Null) {ds.SearchScope = SearchScope.Base; // or SearchScope.OneLevel - your pickup}
Comments
Post a Comment