These links are more for my own reference than anything else to resolve the error:
“Cannot generate SSPI context”
It is a pesky error message that is related to security setup. All the things you need to check are in the MS article below.
In my case (with multiple domains), the below AD change to allow the service account for SQL Server Windows service to read/write SPN’s fixed the issue and the link for the procedure is below.
Clint Boessen’s Blog: Dynamically Set SPN’s for SQL Service Accounts
Checking whether you are using NTLM or Kerberos:
You can check whether a SQL Instance is using NTLM or Kerberos by running this command:
select auth_scheme from sys.dm_exec_connections where session_id=@@spid
More on that is here
- SQL Server connectivity, Kerberos authentication and SQL Server SPN (Service Principal Name for SQL Server)
I will add more links here if I run into this error again and found other references that helped me resolve it.