Cannot Generate SSPI Context – Connection Problem


When I attempted to logon to one of individual node for my AlwaysOn Availability Group,
I received the connection error shown below.
SSPI context error

TITLE: Connect to Server

Cannot connect to < MYSERVER >.


The target principal name is incorrect.  Cannot generate SSPI context. (Microsoft SQL Server, Error: 0)


It appears that the SQL Server Instance was installed using a local system account, then was switched to using an Active Directory service account when configuring the AlwaysOn Availability Group.


***** Warning:  This can not be resolved in SQL Server *****

Fortunately I work with an “Awesome” Windows Domain Administrator, who was able to find an answer that worked for our environment.

He removed the following two SPNs (Service Principal Name), which were registered to the computer object in AD (Active Directory) for problem node.



Once he removed the those two SPNs, I was able to immediately connect to the instance of SQL Server using the node name (server name), without having to restart SQL Server.

Since removing those two SPNs, we have not seen any errors or issues with this instance of SQL Server.

***** Warning: This may not work in all cases, the Windows Domain Administrator may have to further investigate the problem objects. ******

Leave a Comment