How can I get the fully qualified domain name (FQDN) from a SharePoint user (SPUser object)?
Within SharePoint I have an instance of the SPUser class. The LoginName property is a string in the format domain\user, but in this case the domain is the netbios domain name and not the fully qualified domain name (FQDN).
I need the FQDN. There is a SID available to me if that helps. Do I have to do some LDAP query to get this or is there some other way to figure this out?
In the end, I really want the u开发者_Python百科serPrincipalName (e.g., john.doe@corp.mycompany.com). The part after the "@" needs to be the FQDN as another system will be querying the UPN from AD and its value needs to match my value.
Looking at the SPUser and SPUtility class I think your only option is to get it from LDAP using username.
精彩评论