title: Get UPN or email for logged in user in a .NET web application
body: <p>I'm not a .NET developer, and I have a feeling this would be trivial for someone who is:</p>
  
  <p>I have a C# web application that makes user of the user credentials of the logged in user. Currently it uses the SID which comes from </p>
  
  <pre><code>System.Security.Principal.WindowsIdentity.GetCurrent().User.Value 
  </code></pre>
  
  <p>I need to get either the users UPN login or email address (as defined in active directory) instead of the SID.  GetCurrent() returns an object of type WindowsIdentity; looking in the details for WindowsIdentity Members:</p>
  
  <p><a href="http://msdn.microsoft.com/en-us/library/system.security.principal.windowsidentity_members.aspx" rel="noreferrer">MSDN: WindowsIdentity Members</a></p>
  
  <p>I can't see anything that looks like it would give me either the UPN or email in there.  How can I pull up that information to use, either by feeding the SID into some other function or calling something different in the first place.</p>