SharePoint 2013 Hosting :: How to solve cannot generate SSPI context in SharePoint

You get “Cannot connect to Configuration database” while accessing Central Administration or any SharePoint sites.


In Event Viewer we get the below error on the SharePoint server.

Event Type: ErrorEvent Source: Windows SharePoint Services 3Event Category:
Database Event ID: 5586
Date: 7/13/2009
Time: 12:36:31 AM
User: N/A
Description: Unknown SQL Exception 0 occured. Additional error information from SQL Server is included below. Cannot generate SSPI context.

While trying to connect using connect.udl file, it gives the same error “Cannot generate SSPI Context”

On the SQL 2005 Server we get the below error.

Event Type: Error
Event Category: (4)
Event ID: 17836
Date: 6/25/2009
Time: 11:51:45 PM
User: N/A
Length specified in network packet payload did not match number of bytes read; the connection has been closed. Please contact the vendor of the client library. [CLIENT:IP of SP Server]

Quick Resolution: – Reboot the SQL Server 2005

Error Troubleshooting: – How to troubleshoot the “Cannot generate SSPI context” error message

This is related to some SPN configurations gone incorrect on the SQL server.

Logon to the server using Domain Admin rights.
Download Setspn.exe from Microsoft site to set the SPN’s for the SQL server.

At command prompt go to the location where setspn.exe was installed.
C:\Program files\support tools>setspn -L MyDomain\MyUserName
Registered ServicePrincipleNames for CN=MyUserName Service Account, OU=Service Accounts, DC=MyDomain,DC=com: mssqlsvc/ mssqlsvc/

If you are getting the error (Cannot generate SSPI context), you will not find the SQL server name in the list displayed by the command.

To Register your SQL server type the following command.
setspn -A MSSQLSvc/ MyAccount

Note: – MyServer will be the SQL server name to which you are not able to connect.

Again run the setspn -L MyDomain\MyUserName command, you should find your SQL servers FQDN registered.

Best SharePoint Hosting Recommendation provides its customers with Plesk Panel, one of the most popular and stable control panels for Windows hosting, as free. You could also see the latest .NET framework, a crazy amount of functionality as well as Large disk space, bandwidth, MSSQL databases and more. All those give people the convenience to build up a powerful site in Windows server. offers SharePoint hosting starts from $5. We also guarantees 30 days money back and guarantee 99.9% uptime. If you need a reliable affordable SharePoint Hosting, we should be your best choice.