Hi. I would like to know the address of my user's Exchange server (assuming she's in a typical Windows office network). This is in a C# application.
I already have the user's email address, I found it at System.DirectoryServices.AccountManagement.UserPrincipal.Current.EmailAddress
, after referencing System.DirectoryServices.AccountManagement
I use this for my Exchange client application.
C:\Program Files\Microsoft\Exchange\Web Services\1.1\Microsoft.Exchange.WebServices.dll
Now code:
var exchange = new ExchangeService();
exchange.AutodiscoverUrl(from);
var server = exchange.Url.Host;
Console.WriteLine(server);
Here's the MSDN documentation. but note it's for the unreleased version 1.2 of the API. I can't locate the documentation for version 1.1