title: Using Exchange EWS SOAP, how can I get the email address for a given usename
body: <p>I am integrating the login of a NodeJS app to the company's Active Directory using the Exchange Web Services endpoint. This way I can validate if the provided credentials (username and password) match with the Active Directory user's credentials.</p>
  
  <p>So far I was able to successfully validate if a username/password pair is valid. What I couldn't find a solution for is getting the email address given a username.</p>
  
  <p>I cannot query the Active Directory directly using LDAP since the NodeJS app will be hosted outside the company's network. An available option is to use the Exchange Web Services (2010) endpoint.</p>
  
  <p>I am currently doing a ResolveNames operation <a href="http://msdn.microsoft.com/en-us/library/exchange/aa563518(v=exchg.150).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/exchange/aa563518(v=exchg.150).aspx</a></p>
  
  <p>The problem is that doing a Resolvenames  with the username as the <code>UnresolvedEntry</code> value will return several Resolutions, for example if a username is <code>john</code> and there are also other johns in the directory, the <code>Resolvenames</code> query will return those as well. </p>
  
  <p>I am looking for a way to get unambiguously the email address using EWS for a username (which corresponds to the valid credentials being used to query the EWS SOAP service).</p>