I have SQL Server 2014 installed on a Windows Server 2012 R2, which is also an AD DC. When I try to connect to it using SQL Server Management Studio (SSMS) from a client desktop on the same local domain, I got this error message:
The target principal name is incorrect. Cannot generate SSPI context. (Microsoft SQL Server)
So following other posts on the same issue, I downloaded Kerberos Configuration Manager on the SQL server, which found 2 Misplaced SPN. The SPN Script commands proposed by the Kerberos Configuration Manager are as follows:
SetSPN -d "MSSQLSvc/SERVERNAME.internal.domain.com" "internal\SERVERNAME$"
SetSPN -s "MSSQLSvc/SERVERNAME.internal.domain.com" "DOMAIN\SERVERNAME$"
But when I tried to run the first command in cmd on the server (the "SetSPN -d" one), I got this error:
FindDomainForAccount: Call to DsGetDcNameWithAccountW failed with return value 0x0000054B
Unable to locate account SERVERNAME$
I'm not sure how to move forward from here. Googling around hasn't turned out the right answer. Please help. The questions are:
1) Is the misplaced SPN the culprit? If so, how to correct?
2) If not, how can I connect to SQL Server from a client desktop on the same local domain, using Windows authentication?