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:

  1. Initialize the ExchangeClient class with address and credentials.
  2. Get the Contacts folder’s URI with the ExchangeClient.MailboxInfo.ContactsUri property.
  3. Call the ListContacts() method. It returns an array of MapiContact.
  4. 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.