the web shows dozens of examples to query the exchange's global address list but i want to query the specific address lists! So every user in our Enterprise is ofcourse listed in our global address list but i want to query the address list of a specific company within our Enterprise.
In the example below, Aswebo, Cosimco, etc.. are address lists.
- How do I list these address lists?
- How do I list the people within these address lists?
I don't have exchange setup to test this code, so it will need modifications but it should give you a starting point to explore.
The idea is that you set the ItemView to the ContactSchema to retrieve results by company.
You can also use service.FindItems(WellKnownFolderName, SearchFilter, ViewBase) to provide additional filtering.
See this MSDN blog for a code example.
I've been searching all afternoon and came up with the code below. It works.. but looking dirty. I would like an entire Principal approach but it seems I'm too dumb :-)
Anyone that wants to translate this code to 100% 'System.DirectoryServices.AccountManagement'?