Executes a search and passes the results to the caller.
HRESULT ExecuteSearch(
LPWSTR pszSearchFilter, //Search filter string in LDAP format
LPWSTR pAttributeNames, //Attributes to be obtained
DWORD dwNumberAttributes, //Size of pAttributeNames array
PADS_SEARCH_HANDLE phSearchResult
//Search result handle
);
This method returns the standard values E_INVALIDARG, E_OUTOFMEMORY, E_UNEXPECTED, and E_FAIL, as well as the following:
The caller is responsible for calling CloseSearchHandle to release the memory allocated for the search handle and search result.
Using Directory Service Queries