Last post Apr 17, 2008 02:57 AM by Bruno Yu - MSFT
Apr 15, 2008 09:55 AM|soyka|LINK
I have got a generic collection of System.DirectoryServices.Principal objects
Dim results As PrincipalSearchResult(Of Principal)
How do I sort it by DisplayName?
Example or link would be greatly appreciated
Apr 17, 2008 02:57 AM|Bruno Yu - MSFT|LINK
Based on your post, my understanding of your problem is to fmake the filter in AccountManagement class by DisplayName. I would like to provide you the suggestions as follows:
1. The AdvancedSearchFilter property returns object is set read-only properties before passing to the PrincipalSearcher. It is necessary to learn the query by example (QBE) search mechanism searches for objects in a directory
using an existing object. To use QBE, the application creates an instance of a principal object, either computer, user, or group, and sets properties on the object. This object becomes the query filter for the PrincipalSearcher class. For futher information,
please read the content of the link below:
2. The Account Management API provides three concrete directory object classes: UserPrincipal, GroupPrincipal and ComputerPrincipal. Since the directory schema is modifiable, and not every attribute in the schema is represented
by a property on these principal objects, developers may want to create their own custom principal objects. The Principal, AuthenticablePrincipal, UserPrincipal, ComputerPrincipal, and GroupPrincipal classes can all be extended to create custom objects that
extend the object model. The article
Principal Extensions provides you a releated example on extension issue.
3. Additionally, I would like to introduce the article on managing the directory security principal issues that can help you to understand the issue further:
Managing Directory Security Principals in the .NET Framework 3.5
Hope that can help you.