Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: Win7 VPN & SQL server: Cannot generate SSPI context

29 Jan 2010   #1

32bit enterprise
Win7 VPN & SQL server: Cannot generate SSPI context

After alot of searching i found a good solution to the problem when using Windows login to a SQL server while on Win VPN giving the error: Cannot generate SSPI context.

Wanted to share it:
  1. Locate the .pbk file that contains the entry that you dial. Is either: C:\Users\<USERNAME>\AppData\Roaming\Microsoft\Network\Connections\Pbk or if connection is visible to all users: C:\ProgramData\Microsoft\Network\Connections\Pbk
    (hidden files may need to be disabled first through Organize -> Folder and search options)
  2. Open the file in Notepad using Open with...
  3. Locate the following entry: UseRasCredentials=1
    Each VPN connection you have has a section marked with [<VPN connection name>]
  4. Modify the entry to the following: UseRasCredentials=0
    Needs to be done for each VPN section for the connections having problems.
  5. On the File menu, click Save, and the click Exit.

My System SpecsSystem Spec
11 Feb 2010   #2

Windows 7

Great post! I was having this problem also, but the VPN seemed unrelated as I was not traversing the VPN to get to the SQL Servers.

As a "Oh hell! What could it hurt?" attempt I followed your suggestions and it worked!

Thanks for the tip,

My System SpecsSystem Spec
12 Jan 2011   #3

Windows 7 Professional

Spot on! Marvellous post :)

I could not connect to a local SQL server after connecting to another network via VPN. This resolved it.

Many thanks.

My System SpecsSystem Spec

04 May 2012   #4

windows 7 Enterprise edition 32 bit

I am facing similar problem but the resolution specified doesn't seem to appropriate to my case,as we are using Juniper network connect VPN connection and it generates instant proxy service and when connected to SQL DB server it is throwing "SSPI context error"
My System SpecsSystem Spec
21 May 2012   #5

Windows Server 2008 R2 Enterprise


If anyone turns on the "Allow other people to use this connection" option when setting up the VPN connection (I DON'T), I believe location of "common" rasphone.pbk is

C:\Windows\ServiceProfiles\LocalService\AppData\Roaming\Microsoft\Network\Connections\Pbk\_hiddenPbk .

Access to this folder is usually restricted, so as you drill into the folders Windows will (at some point) prompt to allow access.
My System SpecsSystem Spec
18 Jul 2012   #6

Windows 7 Home Premium, 32 bit

I applied this to a laptop running Windows 7 Enterprise 32 bit. We have a GPO in use, but I didn't see any reference to this area in the policy editor. When a new user logged in, the UseRasCredentials was set back to 1. I went in an manually edited the file back to 0. Next time the VPN software was activated, it reverted to 1 again. I'm going back through the GPO, but can't find any reference to RAS in any of the network sections.

We have smart card credentials that authenticate us to both the wired domain and then back in through the VPN concentrator. My biggest problem is trying to figure out why the file reverts back to '1' when starting the VPN (Windows VPN) connection again...

Any suggestions?

My System SpecsSystem Spec
29 Jan 2014   #7


That was very helpful, thanks a lot!
My System SpecsSystem Spec

 Win7 VPN & SQL server: Cannot generate SSPI context

Thread Tools

Similar help and support threads
Thread Forum
How to add 'Print' to Win7 Explorer context menu
How can I add the 'Print' command to a right-click context menu for Word and Excel files (.doc and .xls)? It's missing for both. Thanks so much. The answer's probably here already, but I didn't find it. Sorry.
Microsoft Office
Problem - Win7 64bit Context [Send to]
I have a brand new, custom built, Win7 64bit rig :geek: Problem: When I use the context menu it ONLY shows and all my drives :cry: When I go into my User profile (using SHELL:SENDTO or navigating) my full list IS there. Is there a way to make Win7 refresh or see my full Sent To list?
General Discussion
Can not generate SSPI context
I am having a problem just on this pc runnings windows 7 pro. When I try to retrieve data from a sql server express 2008 r2. I get the following: Can not generate SSPI context. I have no problems with other computers running win 7 pro. thanks
General Discussion
Win7 doesn't want to generate any thumbnails
Hi It suddenly happened..all the thumbnails, even on my desktop disappeared..I tried to check "show icons" in the folder options restart and uncheck..did not help I deleted icon cache manually and with disk cleanup..doesn't help I don't know what's happening... any help is appreciated
General Discussion
Win7 Taskbar Item Context Menus
Hi, For a lack of a better category I'll be putting this question here: When setting up my Windows 7 Installation, I had an extended context menu for every taskbar item, like Frequent Items or Pinned Items for the Windows Explorer. After a couple of weeks of installing it, these contextual...
General Discussion

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 22:25.
Twitter Facebook