SQLServerCentral.com / Administering / SQL Server 2005 / Changed SQL Services Acct - "Cannot Generate SSPI Context" / Latest PostsInstantForum.NET v2.9.0SQLServerCentral.comhttp://www.sqlservercentral.com/Forums/notifications@sqlservercentral.comSun, 02 Aug 2015 14:25:24 GMT20RE: Changed SQL Services Acct - "Cannot Generate SSPI Context"http://www.sqlservercentral.com/Forums/Topic1062029-146-1.aspx[quote][b]TryingToLearn (7/10/2014)[/b][hr]Giving the Service account 'domain admin' privileges for a brief time allowed the SPN error to correct itself or register properly.Thank you[/quote]Exactly what you shouldnt do.Either grant the new account the AD permissionsreadServicePrinciplewriteServicePrincipleor have an AD admin manually create the required SPNFri, 11 Jul 2014 03:11:58 GMTPerry WhittleRE: Changed SQL Services Acct - "Cannot Generate SSPI Context"http://www.sqlservercentral.com/Forums/Topic1062029-146-1.aspxGiving the Service account 'domain admin' privileges for a brief time allowed the SPN error to correct itself or register properly.Thank youThu, 10 Jul 2014 12:26:26 GMTTryingToLearnRE: Changed SQL Services Acct - "Cannot Generate SSPI Context"http://www.sqlservercentral.com/Forums/Topic1062029-146-1.aspx[quote][b]MMartin1 (3/20/2013)[/b][hr]The user account used for SQL Services has to have local admin privileges[/quote]Not true - the user account used for SQL Services does not (and should not, in any high security installation) have local admin rights, much less domain admin rights.The user account does need permissions to a variety of directories for SQL Server files (sometimes it's easier to use[code]icacls * /reset /t[/code]to reset security on entire subdirectory trees).There are some Group Policy permissions that are required or recommended; the set I use includes some for proxy users:[code]gpedit.mscComputer ConfigurationWindows SettingsSecurity SettingsLocal PoliciesUser Rights AssignmentsAct as part of the operating systemAdjust memory quotas for a processBypass traverse checking -- proxy user use, I thinkLock pages in memory -- a subject of some debateLog on as a servicePerform volume maintenance tasks -- required for instant file initializationReplace a process level token -- proxy user use, I think[/code]Thu, 10 Jul 2014 12:23:10 GMTNadrekRE: Changed SQL Services Acct - "Cannot Generate SSPI Context"http://www.sqlservercentral.com/Forums/Topic1062029-146-1.aspxI have tried all these fixes an none worked....any other suggestions?changed service account drop server name/re-added.Any other suggestions. In our environment this happened out of the blue....a user called and could not connect, i am able to connect with SQL authentication. Thu, 10 Jul 2014 10:30:09 GMTTryingToLearnRE: Changed SQL Services Acct - "Cannot Generate SSPI Context"http://www.sqlservercentral.com/Forums/Topic1062029-146-1.aspxI usually have to use:setspn -A MSSQLSvc/Servername.Domain.TopLevelInternalDomain:PortUsually1433 Domain\ADServiceAccountThu, 21 Mar 2013 08:43:01 GMTNadrekRE: Changed SQL Services Acct - "Cannot Generate SSPI Context"http://www.sqlservercentral.com/Forums/Topic1062029-146-1.aspxThe user account used for SQL Services has to have local admin privileges and the Log on as a Service right.Wed, 20 Mar 2013 11:12:58 GMTMMartin1RE: Changed SQL Services Acct - "Cannot Generate SSPI Context"http://www.sqlservercentral.com/Forums/Topic1062029-146-1.aspxI am currently sitting with the same issue on a SQL 2008 R2 server running on a Server 2003 R2 SP2 OS, I had to install the setspn.exe from [url]http://www.microsoft.com/en-us/download/details.aspx?id=4461[/url]I got the server registered by running setspn -R MYSERVERNAME in command prompt.I will let you know if this resolved it after the server gets restarted later.Thu, 17 Jan 2013 07:05:06 GMTFox87RE: Changed SQL Services Acct - "Cannot Generate SSPI Context"http://www.sqlservercentral.com/Forums/Topic1062029-146-1.aspxHope the reboot will fix the problem :-)Mon, 21 Feb 2011 13:29:55 GMTNils Gustav StråbøRE: Changed SQL Services Acct - "Cannot Generate SSPI Context"http://www.sqlservercentral.com/Forums/Topic1062029-146-1.aspxNils, Sorry for the confusion and thanks for all your help ... see my corrected & edited post above.Mon, 21 Feb 2011 12:58:02 GMThomebrew01RE: Changed SQL Services Acct - "Cannot Generate SSPI Context"http://www.sqlservercentral.com/Forums/Topic1062029-146-1.aspxDid you use SQL Server Configuration Manager to change the account? Is the new account member of any local Windows security groups? What errors are logged for SQL Server during startup in the event log and SQL Error log (&lt;SQL Server installation path&gt;\Data\Log\)?Mon, 21 Feb 2011 12:40:31 GMTNils Gustav StråbøRE: Changed SQL Services Acct - "Cannot Generate SSPI Context"http://www.sqlservercentral.com/Forums/Topic1062029-146-1.aspxThanks for the help ... (Big Edit because I think I found the problem... didn't realize there was already a reply)Here's a follow-up for anyone else with a similar problem I logged onto a 3rd server, thinking I could now change the SQL services account to the new account (I'm local admin on the box). It accepts the change, but I get an error of "Access Denied" after chaning the account, and SQL Services won't start. Event Log says: Server local connection provider failed to listen on [ \\.\pipe\SQLLocal\MSSQLSERVER ]. Error: 0x5Worse than before !I search the error and found this, suggesting a reboot should fix it [url]http://blogs.msdn.com/b/sql_protocols/archive/2006/03/09/546655.aspx[/url]" ... snip ... If the listening named-pipes are not closed properly during the last shutdown of SQL Server, there will be orphan named-pipe handles in the windows kernel file system. Since the listening pipes are opened ACLing to the current user, if you happen to switch SQL Server to run under different account, you will get error 0x05(ERROR_ACCESS_DENIED). ... snip ... The solution is to either switch back to previous account and make a clean shutdown of SQL Server, or reboot the machine. In most cases, I feel the later is faster.... snip"... so far, so good:Mon, 21 Feb 2011 12:18:10 GMThomebrew01RE: Changed SQL Services Acct - "Cannot Generate SSPI Context"http://www.sqlservercentral.com/Forums/Topic1062029-146-1.aspxYou can use adsiedit and remove/add the servicePrincipalName in AD, but you can also use another pc or server with Windows and run setspn.Tue, 15 Feb 2011 13:41:12 GMTNils Gustav StråbøRE: Changed SQL Services Acct - "Cannot Generate SSPI Context"http://www.sqlservercentral.com/Forums/Topic1062029-146-1.aspxI 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 ?Tue, 15 Feb 2011 12:34:59 GMThomebrew01RE: Changed SQL Services Acct - "Cannot Generate SSPI Context"http://www.sqlservercentral.com/Forums/Topic1062029-146-1.aspxAt 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.Mon, 14 Feb 2011 09:21:07 GMTNils Gustav StråbøRE: Changed SQL Services Acct - "Cannot Generate SSPI Context"http://www.sqlservercentral.com/Forums/Topic1062029-146-1.aspxIs 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.Mon, 14 Feb 2011 08:25:17 GMThomebrew01RE: Changed SQL Services Acct - "Cannot Generate SSPI Context"http://www.sqlservercentral.com/Forums/Topic1062029-146-1.aspxYou 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 &lt;old account name&gt;If you see a MSSQLSvc/srvname you have to delete it with setspn -DThu, 10 Feb 2011 14:31:08 GMTNils Gustav StråbøRE: Changed SQL Services Acct - "Cannot Generate SSPI Context"http://www.sqlservercentral.com/Forums/Topic1062029-146-1.aspx[quote][b]homebrew01 (2/10/2011)[/b][hr]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 :angry:[/quote]You need to add a SPN in AD.:-)Thu, 10 Feb 2011 14:26:27 GMTWildcatRE: Changed SQL Services Acct - "Cannot Generate SSPI Context"http://www.sqlservercentral.com/Forums/Topic1062029-146-1.aspxI 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.Thu, 10 Feb 2011 12:54:27 GMTJudy WhyRE: Changed SQL Services Acct - "Cannot Generate SSPI Context"http://www.sqlservercentral.com/Forums/Topic1062029-146-1.aspxHow 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 :angry:Thu, 10 Feb 2011 10:07:50 GMThomebrew01RE: Changed SQL Services Acct - "Cannot Generate SSPI Context"http://www.sqlservercentral.com/Forums/Topic1062029-146-1.aspxCan you try to drop server and add server back?Sp_dropserver @ServernameSp_addserver @Servername,localThu, 10 Feb 2011 08:20:46 GMTJudy WhyChanged SQL Services Acct - "Cannot Generate SSPI Context"http://www.sqlservercentral.com/Forums/Topic1062029-146-1.aspxWe 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 ?Thu, 10 Feb 2011 08:10:00 GMThomebrew01