SSMS R2 – Key not valid for use in specified state

Posted: 2011-02-02 in Code and Computers

Problem:

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.

Workaround:       

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: http://www.sqlservercentral.com/Forums/Topic872254-391-1.aspx

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

Other:

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.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s