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 for2: Win7 VPN & SQL server: Cannot generate SSPI context
Thread Forum
Win7 doesn't want to generate any thumbnails General Discussion
Generate Thumbs.db Performance & Maintenance
Solved How to add 'Print' to Win7 Explorer context menu Microsoft Office
Theme missing from file and folder context menu (win7) General Discussion
Solved Cannot generate .flv thumbnails Music, Pictures & Video
Win7 Taskbar Item Context Menus 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 06:35 PM.
Twitter Facebook Google+

Windows 7 Forums

Seven Forums Android App Seven Forums IOS App

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33