A user whose UPN in Active Directory is like domain\first.last2. But when this user is synced with User Profile its Account Name is changed to domain\first.last. How can I diagnose the exact issue with User Profile in SharePoint 2010?
AccountName property is a combination of the NetBIOS domain name and sAMAccountName, not UPN.
Run below command in SharePoint Management Shell to sync user information from AD if Display name or other information have changed except Account name in AD:
Set-SPUser -Identity 'Contoso\userAccount' -Web http://siteA -SyncFromAD
Run Move-SPUser if account name has been changed in AD.
Move-SPUser –Identity "DOMAIN\OldUserName" –NewAlias "Domain\NewUserName"