1
votes

I downloaded the Exchange Server 2010 SP1 SDK in order to start working with the Exchange Web Services.

The first thing I did was open up the AutodiscoverSample to see how Autodiscover worked.

I have two Exchange accounts, each on different Exchange systems.

[email protected] is hosted on Exchange (Microsoft Edu/Friends & Family).

[email protected] is on Office 365.

I can't get it to connect to the the Office 365 system.

I can successfully autodiscover with both in Outlook and on the https://www.testexchangeconnectivity.com website.

If run the sample as:

AutodiscoverSample.exe [email protected] true [email protected] <password> kindel.com

It works fine.

If I run the sample as: AutodiscoverSample.exe [email protected] true [email protected] <password> fiinom.net

I get

=? Trying '[email protected]' at 'https://autodiscover-s.outlook.com/autodiscover/autodiscover.xml'
-! Info: System.Net.WebException: The remote server returned an error: (401) Unauthorized.

Can anyone provide any insight into what might be going on here and how I can fix it?

Could someone else with an Office 365 account check to see if the AutodiscoverSample works for you?

1
FWIW, I realized that the Exchange 2010 SP1 SDK != the EWS 1.1 SDK. I now have things working with the EWS AutodiscoverService class. But that doesn't explain what is wrong with this sample.tig

1 Answers

0
votes

I do not know how AutodiscoverSample.exe works, but from working on my code (straight Win HTTP) and Office 365, autodiscover will be redirected to a different domain (outlook.com), so if credentials cache is used, you must supply credentials for at least 2 domains, even if the user name/password are the same.