Exchange Autodiscovery will provide me with a display username using the UserSettingName.UserDisplayName
property.
However, in cases where autodiscover fails and the connection needs to be completed manually, I cannot figure out how to get DisplayName.
I tried this, but I just got the users email address:
_service = new ExchangeService(); _service.Credentials = new System.Net.NetworkCredential(exchangeSettings.EmailAddress, exchangeSettings.Password); _service.Url = new Uri(exchangeSettings.ExternalEwsUrl); NameResolutionCollection resolvedNames = _service.ResolveName(exchangeSettings.EmailAddress); exchangeSettings.UserDisplayName = resolvedNames.First().Mailbox.Name;
thanks
source share