Hello,
Thank you for posting question on Microsoft Windows Forum.
Based on the error message "The target principal name is incorrect. Cannot generate SSPI context. (Microsoft SQL Server)" generated in SSMS. This error typically points to an issue with Kerberos authentication, most likely due to a mismatch. When your username changed from "@company.com" to "@company.com", even though you have updated credentials locally and switched profiles, the Kerberos system on the server-side (where SQL Server runs) might still be trying to authenticate your old principal name, or the SPN for the SQL Server itself might be incorrectly registered against an old service account, or not updated to reflect the new user principal.
The followings are a few of suggested steps for troubleshooting to the issue.
1.Verify Azure AD Profile Sync:
- Ensure Azure AD shows the new UPN (******@company.com) as the primary username
Check sync status in: Azure Portal → Azure Active Directory → Users
2.Purge Kerberos tickets on the client:
- Open Command Prompt as the user and run:
- klist purge
- klist ticket ->Verify no old UPN remains.
3.Check Existing SPNs:
- Open a command prompt as administrator on a domain-joined machine (or the SQL Server itself) and run:
- setspn -L DOMAIN\SQLSvcAccount
- If the SPNs are incorrect, missing, or registered against an old account, you'll need to correct them.
4.Test Kerberos Auth:
- Running below 2 commands:
- setspn -Q MSSQLSvc/<SQL_Server_FQDN> > Verify SPN registration
- klist get MSSQLSvc/<SQL_Server_FQDN> > Request new ticket
5.Checking Old Profile References:
- Open regedit
- Navigate to this path HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList
- Searching for any keys referencing the old SID (look for profile paths with monika.wozniak)
You can refer to below article for more information regarding the error message.
Hope the above information is helpful!