We are in the throws of testing our new AD in the midst of a new corporate OS (Win7) test, and am having a 'play' with searching the AD to see if the new Windows Server 2003 R2 version is any quicker than the old Windows Server 2000 one.
There are two things I'd like to do but am struggling to underatnd the correct syntax:
- Return a collection of records that match a specific property, i.e. officeLocation
- Select a collection of records by multiple criteria, i.e. officeLocation = x or y
I have the following code to address 1. above but each time it only returns one record:
public static Hashtable GetActiveDirectoryUserData(string queryField, string queryValue)
DirectoryEntry directoryEntry = new DirectoryEntry("my.active.directory");
// create a searcher based on the root entry and set the search filter to search for a
// collection of users based on a specific query...
DirectorySearcher directorySearcher = new DirectorySearcher(directoryEntry)
// define the query filter...
View Complete Post