I'm pretty sure it does not get it from AD, although we are using AD internally. THe issue I am having is with an app that gets the current users name with user.identity.name, and tacks on the @mycompany.com then uses it to send emails from within the app. The problem is some folks with over 20 char names are failing to send email because their name gets cut off. So I am assuming user.identity.name is grabbing the SAMAccountName. I am going to fix it by grabbing the userPrincipalName from AD, but I am hoping to verify whether or not user.identity.name gets its value from the samaccountname.
EDIT to add more info. In this particular case, it is a WinForms app running on an internal server. We use Forms Authentication to authenticate against AD (at least that is how it was explained to me ). So if user.identity.name is in fact pulling from AD in this case, is there a way to specify the UPN instead of sam account name?