Last active
August 29, 2015 14:18
-
-
Save svrooij/2be856f613cc365263c0 to your computer and use it in GitHub Desktop.
Resolve exchange alias to SMTP-address
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var service = new ExchangeService(ExchangeVersion.Exchange2007_SP1); | |
service.Url = new Uri("https://serv/EWS/exchange.asmx"); | |
service.Credentials = new NetworkCredential("001234", "PasswordForUser001234", "Domain"); | |
//Never use this part in production!! | |
//ServicePointManager.ServerCertificateValidationCallback = (object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) => | |
// { | |
// return true; | |
// }; | |
var resolvedNames = service.ResolveName("001234"); | |
foreach (var resolvedName in resolvedNames) | |
{ | |
Console.WriteLine(resolvedName.Mailbox.Address); | |
} | |
//FOUND on: http://stackoverflow.com/questions/6081243/get-logged-on-users-smtp-address-via-ews |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment