Cannot generate SSPI context when connecting to SQL Server when a VPN is connected

We setup a VPN connection to another site, but then programs would not connect to SQL Server using Windows Authentication. We spent a fair bit of time trying to resolve this. Then found the solution, thanks to the following post:


http://www.sevenforums.com/network-sharing/59414-win7-vpn-sql-server-cannot-generate-sspi-context.html

After a lot 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.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: