SSMS R2 – Key not valid for use in specified state

Posted: 2011-02-02 in Code and Computers


After the installation SSMS on a new computer you may be faced with the above  exception message upon startup: “System.Security.Cryptography.CryptographicException: Key not valid for use in specified state“, if you select continue the registered server panel is non functional.
This exception seems to be unavoidable if your company uses global profiles and you change computers.


First before you reformat your other computer, export your registered servers to a file and include the passwords; right click on local server groups icon and export.
Do not uncheck the password save box as you will fail during the import with the same message as above. Just as a heads up, currently there is no way to export non windows autheniticated servers username and passwords, you will need to redo this by hand :(.
More info about this here:

On the computer with the problems rename you regsrvr.xml file to regsrvr.xml.old. This will cause SSMS to recreate a functional xml file.
This file can be found at:

Win 7:

C:\Users\[USERNAME]\AppData\Local\Microsoft\Microsoft SQL Server\100\Tools\Shell\RegSrvr.xml


C:\Documents and Settings\[USERNAME]\Application Data\Microsoft\Microsoft SQL Server\100\Tools\Shell\ RegSrvr.xml

Restart management studio, everything should work now.

You should be able to re import your registered servers by right clicking on the local server groups and import the file.

Happy hunting.


Leave a Reply

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

You are commenting using your 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