Answered by:
"Key not valid for use in specified state"

Question
-
In SQL Server Management Studio V17.9 I used the option to export registered servers (including passwords) from one computer and import into another, it didn't work well. Now I get this error each time I open the "Registered Servers" window on the computer were I imported the servers:
Key not valid for use in specified state. "System.Security"
How can I clear the installation of this import and start over? I tried deleting this folder to no avail:
C:\Users\{user}\AppData\Roaming\Microsoft\SQL Server Management Studio\14.0
- Edited by Pawaw Monday, October 8, 2018 12:23 PM typo
Monday, October 8, 2018 9:38 AM
Answers
-
Ok to answer my own question, to clear the error this file needs to be deleted:
C:\Users\{user}\AppData\Roaming\Microsoft\Microsoft SQL Server\140\Tools\Shell\RegSrvr.xml
It would be nice if the SMSS team could fix the import/export to work as intended including passwords.
Monday, October 8, 2018 10:53 AM
All replies
-
Ok to answer my own question, to clear the error this file needs to be deleted:
C:\Users\{user}\AppData\Roaming\Microsoft\Microsoft SQL Server\140\Tools\Shell\RegSrvr.xml
It would be nice if the SMSS team could fix the import/export to work as intended including passwords.
Monday, October 8, 2018 10:53 AM -
Thanks PAWAW , it worked for me, I replaced it with a new one which had all my server details.
And Yes, it will be great if MS can fix the bug.
Thanks,
Abdul
Tuesday, October 16, 2018 3:23 PM -
Ok to answer my own question, to clear the error this file needs to be deleted:
C:\Users\{user}\AppData\Roaming\Microsoft\Microsoft SQL Server\140\Tools\Shell\RegSrvr.xml
It would be nice if the SMSS team could fix the import/export to work as intended including passwords.
You can keep the file, but you have to remove all the lines with string "ConnectionStringWithEncryptedPassword".
This can be done easily with notepad++, ctrl + f, find and bookmark all lines then Search -> Bookmark -> Remove Bookmarked Lines.Thursday, April 11, 2019 6:09 AM -
My file was in a different place, so I searched for it. I opened the file and deleted the document key for the servers that were causing the password errors...basically, the only servers in the file not using Windows Authentication. Problem solved.Tuesday, September 10, 2019 2:23 AM
-
My file was also in a different place. I'm using SQL Server Management Studio V18.3.
C:\Users\{user}\AppData\Roaming\Microsoft\SQL Server Management Studio
Also deleted all XML elements of "RegisteredServers:ConnectionStringWithEncryptedPassword" for the error to stop re-occurring whenever I refresh the Database Engine node in the Registered Servers panel.
- Proposed as answer by SteveSombati Friday, January 17, 2020 7:25 PM
Thursday, January 9, 2020 5:52 AM -
This was the answer for me! Thanks!Friday, January 17, 2020 7:25 PM