Error:
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.
Couse:
During an attempt to minimize the number of TempDB files I have tried to restart the server with Minimal Configuration, since I tried to do so in the wrong way (see relevant post here) I have started to get phon call from all my users saying that they can not access the SQL server.
Issue description:
After the server started.
- I couldn’t connect to it from my local computer using my credentials (windows authentication) via the SQL Management Studio.
- When I remote control the SQL server using my admin credentials I was able to connect to the SQL server using my credentials (windows authentication) via the SQL Management Studio.
Solution description:
The SPN (Service Principal Name) mechanism define an active directory user used by different services (such as SQL) to connect and authenticate user with the active directory service.
- Open a cmd window from any station in the domain using domain admin privileges.
- We will run the command setspn -x to get all Active Directory’s SPNs.
- If previous command did not return the ‘current’ spn user of our server, we will run the following command.
setspn -q <SERVER> - If previous command did return a ‘wrong’ spn user between our server and the active directory, we will delete it using the following command.
setspn -d <accountname> <SERVER> - After we have deleted the ‘wrong’ spn we will create a new ‘current’ spn using the following command.
setspn -s <accountname> <SERVER>
how to prevent the issue in the future:
- When we will be asked by different solution to restart the SQL server with some switches, we should do it using the SQL Configuration Manager and NOT using the cmd.