http://www.sqlservercentral.com/blogs/james-sql-footprint/2013/01/19/got-cannot-generate-sspi-context-error-message-after-changing-sql-service-account/ Printed 2014/08/31 12:28AM
Got "Cannot generate SSPI context" error message after changing sql service accountToday I changed a sql server service startup account during testing, then when I tried to connect sql server with powershell, I got error message below:
The target principal name is incorrect. Cannot generate SSPI context."
Here is the troubleshooting step I used
1. Rollback service startup account to old one, then the powershell script work. so it should be the issue with the new account.
2. Start sql server service again with new account. check sql server error log, then found error message in it
2013-01-20 00:53:36.49 Server The SQL Server Network Interface library could not register the Service Principal Name (SPN) for the SQL Server service. Error: 0x2098, state: 15. Failure to register an SPN may cause integrated authentication to fall back to NTLM instead of Kerberos. This is an informational message. Further action is only required if Kerberos authentication is required by authentication policies.
the error indicted sql server service can not register SPN during startup.
3. search the error code 0x2098, found link below
- 8344 (0x2098)
Insufficient access rights to perform the operation.
4. grant "Read servicePrincipalName" and "Write servicePrincipalName" permission to new account.
for window 2012 AD, it is a little bit different
- Click Start, click Run, type Adsiedit.msc, and then click OK.
- In the ADSI Edit snap-in, expand Domain [DomainName], expand DC= RootDomainName, expand CN=Users, right-click CN= AccountName, and then click Properties.
- In the CN= AccountName Properties dialog box, click the Security tab.
- On the Security tab, click Advanced.
- In the Advanced Security Settings dialog box, select one of "SELF"'s row just like the pic below
6. Click Edit, Open Permission Entry dialog box.
7. Make sure Pricipal is "SELF", Type is "Allow" and "Applied to" is "This Object Only", in Properties section, select the properties below:
8. Click OK three times, and then exit the ADSI Edit snap-in.
after restart the sql server service, make sure the spn resgister correctly:
2013-01-20 03:08:27.20 Server The SQL Server Network Interface library successfully registered the Service Principal Name (SPN) [ MSSQLSvc/machinename.domainname.com ] for the SQL Server service.