c# - Microsoft Exchange Services - How to get exact match using Resolve -
here question related microsoft exchange-integration. calling microsoft exchange services-method resolvename (string)
:
i passing in username, e.g. myusername
, , 2 matches -one match username myusername
, 1 myusername2
. question is: there possibility call returns direct matches, matches exact username returned?
here follows code: :
var service = service.getservice(); username = regex.replace(username, ".*\\\\(.*)", "$1", regexoptions.none); var resolvednames = service.resolvename(username); foreach (var resolvedname in resolvednames) { mailboxname = resolvedname.mailbox.address; }
that method resolves e-mail addresses, exact match you'd need this.
string username = "myusername"; string domain = "mydomain.com"; string emailaddress = username + "@" + domain; nameresolutioncollection resolvedcontactlist = _service.resolvename(emailaddress);
Comments
Post a Comment