{"id":1578,"date":"2018-04-01T13:07:46","date_gmt":"2018-04-01T13:07:46","guid":{"rendered":"http:\/\/www.theSQLReport.com\/?p=1578"},"modified":"2018-04-01T13:07:46","modified_gmt":"2018-04-01T13:07:46","slug":"cannot-generate-sspi-context-connection-problem","status":"publish","type":"post","link":"https:\/\/www.theSQLReport.com\/?p=1578","title":{"rendered":"Cannot Generate SSPI Context &#8211; Connection Problem"},"content":{"rendered":"<p><strong>Problem:<\/strong><\/p>\n<p>When I attempted to logon to one of individual node for my AlwaysOn Availability Group,<br \/>\nI received the connection error shown below.<br \/>\n<a href=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2018\/03\/SSPIerror.jpg\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1580 size-full\" src=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2018\/03\/SSPIerror.jpg\" alt=\"SSPI context error\" width=\"619\" height=\"381\" \/><\/a><\/p>\n<pre>TITLE: Connect to Server\r\n\r\nCannot connect to &lt; MYSERVER &gt;.\r\n\r\nADDITIONAL INFORMATION:\r\n\r\nThe target principal name is incorrect.\u00a0 Cannot generate SSPI context. (Microsoft SQL Server, Error: 0)<\/pre>\n<p><strong>Issue:<\/strong><\/p>\n<p>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.<\/p>\n<p><strong>Resolution:<\/strong><\/p>\n<p><strong>***** Warning:\u00a0 This can not be resolved in SQL Server *****<br \/>\n<\/strong><\/p>\n<p>Fortunately I work with an &#8220;Awesome&#8221; Windows Domain Administrator, who was able to find an answer that worked for our environment.<\/p>\n<p>He removed the following two SPNs (Service Principal Name), which were registered to the computer object in AD (Active Directory) for problem node.<\/p>\n<pre>MSSQLSvc\/&lt;MyServer.MyDomain&gt;\r\n\r\nMSSQLSvc\/&lt;MyServer.MyDomain&gt;:1433<\/pre>\n<p>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.<\/p>\n<p>Since removing those two SPNs, we have not seen any errors or issues with this instance of SQL Server.<\/p>\n<p><strong>***** Warning: This may not work in all cases, the Windows Domain Administrator may have to further investigate the problem objects. ******<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Problem: When I attempted to logon to one of individual node for my AlwaysOn Availability Group, I received the connection error shown below. TITLE: Connect to Server Cannot connect to &hellip; <a class=\"readmore\" href=\"https:\/\/www.theSQLReport.com\/?p=1578\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":1580,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,10],"tags":[125,129,127,128,126],"class_list":["post-1578","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sql-server","category-windows","tag-active-directory","tag-alwayson-availability-group","tag-service-principal-name","tag-spi","tag-sspi"],"_links":{"self":[{"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/posts\/1578"}],"collection":[{"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1578"}],"version-history":[{"count":12,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/posts\/1578\/revisions"}],"predecessor-version":[{"id":1591,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/posts\/1578\/revisions\/1591"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/media\/1580"}],"wp:attachment":[{"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1578"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1578"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1578"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}