Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 123»»»

Changed SQL Services Acct - "Cannot Generate SSPI Context" Expand / Collapse
Author
Message
Posted Thursday, February 10, 2011 8:10 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: 2 days ago @ 8:10 PM
Points: 2,826, Visits: 8,463
We want to rollout a new account to use for SQL Services. On a Dev server (SQL 2005 SP3, Windows Server 2003 SP2), I changed the account through SQL Configuration Manager. After restarting the services, from my remote desktop, I get an error "Cannot Generate SSPI Context" when I try to connect with Windows Authentication. 'sa' connects fine remotely, and Windows authentication is fine if I log on to the server and open SQL there.

I've tried various combinations of changing services to LocalSystem, then back to the new account, rebooting between changes, doing steps in different sequence. Once or twice, it has then worked, but when I try later, I get the error again.

Is there a "best practice" list for changing SQL services to a new account ?



Post #1062029
Posted Thursday, February 10, 2011 8:20 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Tuesday, April 15, 2014 6:27 AM
Points: 568, Visits: 813
Can you try to drop server and add server back?

Sp_dropserver @Servername
Sp_addserver @Servername,local
Post #1062040
Posted Thursday, February 10, 2011 10:07 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: 2 days ago @ 8:10 PM
Points: 2,826, Visits: 8,463
How would that help ? Isn't that for renaming the server ?


I just changed the Service account to LocalSystem, restarted, changed to my new SQL Service Account, restarted, and it worked - I could connect.

Then I rebooted the server and got the error again ?!?!?! Back to square 1



Post #1062126
Posted Thursday, February 10, 2011 12:54 PM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Tuesday, April 15, 2014 6:27 AM
Points: 568, Visits: 813
I had a similiar experience. SQL logins had no problem to connect to SQL. only one Windows Logins could connect, other not.

Drop server and add server did help on my case.
Post #1062261
Posted Thursday, February 10, 2011 2:26 PM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Tuesday, March 18, 2014 1:26 PM
Points: 405, Visits: 1,431
homebrew01 (2/10/2011)
How would that help ? Isn't that for renaming the server ?


I just changed the Service account to LocalSystem, restarted, changed to my new SQL Service Account, restarted, and it worked - I could connect.

Then I rebooted the server and got the error again ?!?!?! Back to square 1


You need to add a SPN in AD.
Post #1062313
Posted Thursday, February 10, 2011 2:31 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Friday, June 6, 2014 7:58 AM
Points: 1,837, Visits: 3,420
You need to manually delete the SPN fo MSSQLSvc in AD linked to the old account.

Run this in a command prompt to verify that there is a MSSQLSvc SPN registered on the old account:

setspn -L <old account name>

If you see a MSSQLSvc/srvname you have to delete it with setspn -D
Post #1062318
Posted Monday, February 14, 2011 8:25 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: 2 days ago @ 8:10 PM
Points: 2,826, Visits: 8,463
Is this an expected situation when changing the SQL Service account ?
Or did I do something wrong initially ?

I'd like to avoid any problems when I do the production servers.



Post #1063565
Posted Monday, February 14, 2011 9:21 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Friday, June 6, 2014 7:58 AM
Points: 1,837, Visits: 3,420
At least it is what has happened to me every time we change the service account. I don't know if there is a way to avoid it (having the account removing and re-registering the SPN). Perhaps someone else can enlighten us on this issue.
Post #1063618
Posted Tuesday, February 15, 2011 12:34 PM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: 2 days ago @ 8:10 PM
Points: 2,826, Visits: 8,463
I don't see SETSPN.exe on the server, so maybe server tools are not installed. Perhaps the original problem is caused by the old SQL Services account being a domain admin at some point, and the new SQL Services account I want to use is only a local admin on the sever, and can't alter the SPN behind the scenes when I change the logon information for the service ?


Post #1064507
Posted Tuesday, February 15, 2011 1:41 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Friday, June 6, 2014 7:58 AM
Points: 1,837, Visits: 3,420
You can use adsiedit and remove/add the servicePrincipalName in AD, but you can also use another pc or server with Windows and run setspn.
Post #1064544
« Prev Topic | Next Topic »

Add to briefcase 123»»»

Permissions Expand / Collapse