Query multiple object classes from AD using LDAP Query
Recently I had to make a query to the Active Directory to get the list of users and contacts. To achieve this, I used the LDAP query. See the following function:
///<summary> /// Queries the Active Directory using LDAP ///</summary> ///<param name="entry">Directory entry</param> ///<param name="search">Directory searcher with properties to load and filters</param> ///<returns>A dictionary with ObjectGuid as the key</returns> public static Dictionary<string, SearchResult> QueryLDAP(DirectoryEntry entry, DirectorySearcher search) { entry.AuthenticationType… [Keep reading] “Query multiple object classes from AD using LDAP Query”