September 2009
S M T W T F S
« Jun   Oct »
 12345
6789101112
13141516171819
20212223242526
27282930  

SQL Service Accounts and SPNs (Service Named Principals)

Ah, the nuisances of AD and Kerberos. Whenever you change the service account on a SQL instance, you need to make sure that an SPN pointing to the SQL instance is in place for the Service Account. Otherwise, you might get the dreaded “cannot generate sspi context” error. To manage SPNs registered on your service accounts, you will need to use the setspn.exe utility, which is available here.

To see which SPNs are registered with your SQL Service account:

setspn.exe -l <current_service_account>

Unregister the SPN for the old SQL Service account:

setspn.exe -D MSSQLSvc/full.name.to.your.host.here:1433 <old_service_account>

Finally, register the SPN for the new SQL Service account:

setspn.exe -A MSSQLSvc/full.name.to.your.host.here:1433 <new_service_account>

If you use named instances, the syntax for the command will vary slightly. See this post by Jeff Gilbert which has information on syntax to use and other details.

You could also get SSPI errors if there is no registered SPN for the SQL Service on the host itself. See Jeff Gilbert’s post for details on that.

6 comments to SQL Service Accounts and SPNs (Service Named Principals)

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">