The target principal name is incorrect. Cannot generate SSPI context.

The point of this post is so I don't forget how to solve this in the future.

Every once in a while I receive the error message: "The target principal name is incorrect. Cannot generate SSPI context." when trying to connect to a SQL Server instance on another machine on the network (same domain). Every time I get this message I can't remember how to fix it (usually because I tried dozens of things and don't know which one actually worked). This time, however, I only tried two... and one (or both) of them worked!

So, future self, this will (probably) fix this:

  1. Make sure you aren't connected to a VPN (or make sure you are connected, if needed). Test to see if it works, if it works, stop here. :-)
  2. Make sure IPV6 is disabled (no idea why).
  3. Remote in to your server as the Admin.
  4. Go to Administrative Tools -> Active Directory Users and Computers.
  5. Computers -> {Your Computer}: Right Click -> Refresh.
  6. Users -> {You}: Right Click -> Properties -> Account: Check "Unlock account" -> Apply.

To those of you who are not me, I'm sorry these instructions are crap, but hopefully it'll give you an idea of what to try.

Comments for this blog entry