1
votes

Does anyone have experiences using Exchange Managed Webservices and Exchange Online (Office 365)

Are there Breaking Changes between a normal Exchange and the online? May I take the normal api for this ?

Any hints?

1

1 Answers

2
votes

first of all it's important to know that O365 is currently running Exchange Server 2010 Service Pack 1 what has to be specified when using Exchange Managed API.

The exchange autodiscover is done by a centralized exchange cluster, so you have to enable the redirection here.

var service = new ExchangeService(ExchangeVersion.Exchange2010_SP1)
{
   Credentials = new WebCredentials("MyO365UserId", "Password")
};

service.AutodiscoverUrl("[email protected]", delegate { return true; });
var allContactsFromO365 = service
   .FindItems(WellKnownFolderName.Contacts, new ItemView(99));

foreach (var contact in allContactsFromO365
            .Where(item => item as Contact != null)
            .OfType<Contact>())
{
     Console.WriteLine(contact.DisplayName);
}

Hope that helps a little bit.

So as you can see it's regular managed API code..

have fun