I'm building an app that will run in production on a Windows Server 2008 R2 web server.
It should connect to a shared mailbox using a Windows service account that is in an AD group that has access to the shared mailbox. My network login has access to the shared mailbox. When I call the EWSMA AutodiscoverUrl method with my login
name and password, it connects just fine and I can see everything in that mailbox. When I call it with the service account info, it tells me "The Autodiscover service couldn't be located."
public ExchangeService Service = new ExchangeService(ExchangeVersion.Exchange2013_SP1);
Service.Credentials = new WebCredentials("me@confused.com", "password");
Service.AutodiscoverUrl("me@confused.com", RedirectionCallback);
SharedMailboxName = "thesharedmailboxname";
static bool RedirectionCallback(string url)
{
// Return true if the URL is an HTTPS URL.
return url.ToLower().StartsWith("https://");
}
I'm told that our company is now using Office365 and Exchange in the cloud but I don't see any differences in suggested code based on that. I have tried calling WebCredentials with every variation of username and domain that has been suggested, and
get the same result. I'm now reduced to poking it with a stick. Any ideas?