Win7 VPN & SQL server: Cannot generate SSPI context

  1. aas
    Posts : 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 Computer

  2. Posts : 1
    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 Computer

  3. Posts : 1
    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 Computer

  4. Posts : 1
    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 Computer

  5. Posts : 1
    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 Computer

  6. Posts : 1
    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?

    Last edited by CrazyTalk; 18 Jul 2012 at 18:12. Reason: clarification
      My Computer

  7. Posts : 1


    That was very helpful, thanks a lot!
      My Computer


  Related Discussions
Our Sites
Site Links
About 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:21.
Find Us