Working with Contacts on Exchange Server using WebDav
Getting Contacts from an Exchange Server
The ExchangeClient class’ ListContacts() method can be used to get contact information from an Exchange Server. ListContacts() method requires the URI of the Contacts folder, which can be easily got with the ExchangeMailboxInfo.ContactsUri property.
To get contacts from an Exchange Server:
- Initialize the ExchangeClient class with address and credentials.
- Get the Contacts folder’s URI with the ExchangeClient.MailboxInfo.ContactsUri property.
- Call the ListContacts() method. It returns an array of MapiContact.
- Do a foreach loop on the MapiContact array to read the contact information.
The following code snippet shows you how to use ExchangeClient class to read all contacts from an Exchange Server.