List all UPN Suffixes from Active Directory
问题 I'm trying to get a list of all upnsuffixes from AD using C#. I tried this with no success public static List<string> GetuPNSuffixes() { DirectoryEntry partitions = new DirectoryEntry("LDAP://xxxxx.com/CN=Partitions,CN=Configuration,DC=xxxxx,DC=com", "user", "pass"); DirectorySearcher searcher = new DirectorySearcher(partitions); searcher.PropertiesToLoad.Add("uPNSuffixes"); List<string> suffixes = new List<string>(); foreach (SearchResult sr in searcher.FindAll()) { foreach (string pn in sr