none
SQL Server Mgt Studio 2008 installation problem - Key not valid for use in specified state RRS feed

  • Question

  • I'm setting up SQL Server Management Studio 2008 on my laptop.  It installed fine, but failed to import a regsrver file exported from another machine. This appears to have been due to the fact that I exported the file with usernames and passwords, although I must admit that's pretty darned inconvenient if it can't be done. 

    Nevertheless, I exported the file again without usernames and passwords, but the new install now won't let me even see servers, let alone import any new ones.

    When I start Studio, it gives me the "Key not valid for use in specified state" error.  When I 'continue', I'm delivered to a screen with the 'registered servers' pane crippled.  It has no contents at all and no ability to add, select, import, export.  Nothing there.

    How do I rectify this?

    The installation is on Windows 7 Home Premium.

    Thanks for any suggestions.

    Tuesday, February 9, 2010 10:37 PM

Answers

  • Hi Don,
    Since this issue was still not resolved even after you reinstall SQL Server 2008, I think that this issue is probably related to some corrupted files or registry keys. Please refer to the following steps to see if you can resolve this issue:
    1. Close your SSMS;
    2. Go to the folder %appdata%\Microsoft\Microsoft SQL Server\100\Tools\ and check if there is a Shell folder, if so, rename it to Shell-Copy;
    3. Re-open your SSMS to see if the error persists.

    Everytime SQL Server 2008 Management Studio starts, it will read information from this folder to retrieve and recover some data. If the information does not exists, it will recreate new ones. Please check if this helps.

    Best regards,
    Charles Wang



    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    • Marked as answer by doncx Friday, February 12, 2010 1:24 PM
    Friday, February 12, 2010 11:42 AM
    Moderator

All replies

  • Hi,
    Why did you import a regsrver file from another machine? This is not a supported method. To resolve this issue, please remove the SSMS from Add/Remove program and re-install it from your SQL Server 2008 setup CD.

    Best regards,
    Charles Wang


    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    Thursday, February 11, 2010 9:43 AM
    Moderator
  • Charles -

    Thanks for your reply.  To put it simply, I attempted the import because I could, and because I saw no information suggesting that I couldn't or shouldn't.  It seems strange to me that this limitation is not handled more elegantly.  I *usually* use import and export capabilities in software to transfer information between systems - don't you?  Wouldn't it be 'backup' and 'restore' otherwise?

    In any case, I certainly appreciate your help.

    I have completely uninstalled all features of SQL Server 2008 and then reinstalled it.  I believe this includes SSMS.  I have then installed sp1 (required for Win7).  But the problem persists.  The error appears at startup and the Registered Servers pane is blank, showing nothing and not allowing right-click.  I can connect to servers, but not register them.  I have also attempted 'repair' of the shared components, to no avail.

    Is there a file to delete or registry entry to change?

    Again, my sincere thanks for your assistance.

    - Don

    Thursday, February 11, 2010 2:30 PM
  • Hi Don,
    Since this issue was still not resolved even after you reinstall SQL Server 2008, I think that this issue is probably related to some corrupted files or registry keys. Please refer to the following steps to see if you can resolve this issue:
    1. Close your SSMS;
    2. Go to the folder %appdata%\Microsoft\Microsoft SQL Server\100\Tools\ and check if there is a Shell folder, if so, rename it to Shell-Copy;
    3. Re-open your SSMS to see if the error persists.

    Everytime SQL Server 2008 Management Studio starts, it will read information from this folder to retrieve and recover some data. If the information does not exists, it will recreate new ones. Please check if this helps.

    Best regards,
    Charles Wang



    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    • Marked as answer by doncx Friday, February 12, 2010 1:24 PM
    Friday, February 12, 2010 11:42 AM
    Moderator
  • Charles -

    That worked!

    I had not been able to find the location of the shell directory (I'm a Windows 7 newbie), and also wasn't aware that the entire directory would be recreated.

    Thank you very much!

    Perhaps you can advise me on how to achieve my original intent - to import dozens of registered servers from another computer.  I attempted it again - this time without usernames and passwords - and it still didn't work.

    Is there no way to do this?  Is that possible?

    Thanks again,

    - Don
    • Proposed as answer by Steven Lynn Tuesday, March 16, 2010 7:08 PM
    Friday, February 12, 2010 1:24 PM
  • Hi Don,
    Are there any error messages showed up? You may also check Windows Event Logs on this.

    I performed a test at my side with Export/Import registered servers in SSMS on two servers and it worked fine with/without choosing the option "Do not include user name and passwords in the export file". Here are my steps:
    1. On server1, start SSMS, click Cancel on the "Connect to Server" window;
    2. Click Views->Registered Servers, make sure that the icon for the Database Engine is selected at the top of the Registered Servers panel;
    3. Right click Local Server Groups, select Tasks->Export..., input the Export File path and click OK.
    4. Copy the exported file to server2;
    5. On server2, start SSMS, click Cancel on the "Connect to Server" window;
    6. Click Views->Registered Servers, make sure that the icon for the Database Engine is selected at the top of the Registered Servers panel;
    7. Right click Local Server Groups, select Tasks->Import..., select the file (.regsrvr) and click OK.

    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    Tuesday, February 16, 2010 2:54 AM
    Moderator
  • Hi Don,

    I was just now searching for answers to the same problem when I found this thread.  I just wanted to share that I finally resolved the issue by editing the RegSrvr.xml file removing the "password=....;" part of the <RegisteredServers:ConnectionStringWithEncryptedPassword> element.

    Steven
    Tuesday, March 16, 2010 7:11 PM
  • Hi Don,
    Since this issue was still not resolved even after you reinstall SQL Server 2008, I think that this issue is probably related to some corrupted files or registry keys. Please refer to the following steps to see if you can resolve this issue:
    1. Close your SSMS;
    2. Go to the folder %appdata%\Microsoft\Microsoft SQL Server\100\Tools\ and check if there is a Shell folder, if so, rename it to Shell-Copy;
    3. Re-open your SSMS to see if the error persists.

    Everytime SQL Server 2008 Management Studio starts, it will read information from this folder to retrieve and recover some data. If the information does not exists, it will recreate new ones. Please check if this helps.

    Best regards,
    Charles Wang



    Please remember to mark the replies as answers if they help and unmark them if they provide no help

    To add to Don's comment, if you are using a different account (for example, an SA account) to run SQL Server management studio then make sure to change the user profile name when you browse to "%appdata%\Microsoft\Microsoft SQL Server\100\Tools\".

    I know many of us developers have multiple accounts and I usually have my SA account have logon privileges on databases not my regular AD Account.

    Other than that, the reason why this fails is because MS encrypted the regsrvr file on the source computer using the source computer's ID and is therefore unable to decrypt the file on the destination computer. To me that just doesn't make sense since the whole idea of Export and import was to move this information across computers! And that's why this works when you import without username and passwords - no more encryption/decryption. Since we use integrated windows logon (trusted_connection=true) it works great. For the few servers that we had SQL Logons I had to manually type them in and save. But all in all, pretty painless.

    • Proposed as answer by IanBoyd Tuesday, November 27, 2012 4:09 PM
    Monday, January 17, 2011 11:46 PM
  • Hi Charles,

    You'll find this method supported and documented by Microsoft.

    How to: Export Registered Server Information (SQL Server Management Studio)

    http://msdn.microsoft.com/en-us/library/ms190246(v=sql.90).aspx

    How to: Import Registered Server Information (SQL Server Management Studio)

    http://msdn.microsoft.com/en-us/library/ms190711(v=sql.90).aspx

    Now that we've established that it's supported; how do we make it work?

    Tuesday, November 27, 2012 4:03 PM
  • Hi Don,
    Since this issue was still not resolved even after you reinstall SQL Server 2008, I think that this issue is probably related to some corrupted files or registry keys. Please refer to the following steps to see if you can resolve this issue:
    1. Close your SSMS;
    2. Go to the folder %appdata%\Microsoft\Microsoft SQL Server\100\Tools\ and check if there is a Shell folder, if so, rename it to Shell-Copy;
    3. Re-open your SSMS to see if the error persists.

    Everytime SQL Server 2008 Management Studio starts, it will read information from this folder to retrieve and recover some data. If the information does not exists, it will recreate new ones. Please check if this helps.

    Best regards,
    Charles Wang



    Please remember to mark the replies as answers if they help and unmark them if they provide no help

    Thanks that helped me with SQL 2012 SP1.

    Had the same issue, I tried to export from my old 2008 R2 ssms into the new sql 2012 ssms with sa login information. I got the error message and the registered servers function was blocked.

    I opened the link over the explorer and renamed the folder. After that i was able to import a new file without the sa information.

    Thanks for the help

    Tuesday, March 12, 2013 7:53 PM
  • The location for the "Shell" folder is:  C:\Users\<USERNAME>\AppData\Roaming\Microsoft\Microsoft SQL Server\110\Tools\
    Friday, December 13, 2013 8:10 PM
  • Hi Don,


    Did you eventually make this work? :-). I scrolled quickly to the end of this article to see the "Final Answer". I mean I have this same exact problem, word-word that you expressed. I have SQL authentication on all the servers. I want the passwords and usernames to pop up automatically when I give the file to another developer.

    Why is this hard to understand?  Its Export-Import and we should be ready to go. That's how the world works. If another guy has to enter passwords to the 60 servers again, why have this feature??


    Don, If you remember how you resolved this, it would help me out a lot. Again I know how to rename shell directory or whatever "other people in tghis forum". That's not my intent. I have 50 servers registered on my box with usernames and password and I need to give it to another newbie so that he is up and running. How in the world do U do it.

    Thanks-Matt


    Friday, February 6, 2015 2:28 AM