Sorting on directorySearcher based on two properties in c#
问题 I'm trying to get a sorted SearchResultCollection object based on department, and then by name (both alphabetical). I'm trying to load two properties, but this merely takes the last property specified and sorts it based on that. My current code is the following: DirectoryEntry entry = new DirectoryEntry(ConfigurationManager.AppSettings["LDAP"]); DirectorySearcher search = new DirectorySearcher(entry) { SearchScope = SearchScope.Subtree, Filter = "(&(objectClass=user)