Forum Discussion

UnknownSQLDBA's avatar
UnknownSQLDBA
Copper Contributor
May 08, 2024
Solved

Registering SQLServers in SSMS v20 using Powershell

Hello
I have a new VM - Windows 11,

Installed SSMS V20.1 today
Installed SQLServer Powershell Module. SQLServer Module version is 22.2.0 . Only 1 version installed.

(Install-Module -Name SqlServer -Repository PSGallery -Force)

When I go into powershell and do the following
Set-Location "SQLSERVER:\SQLRegistration\database Engine Server Group"
new-item "TestFolder"

 

This TestFolder does not show up in SSM v20 (Registered Servers Group)

Similarly If i got into SSMS v20, and create a folder named "TestSSMS", 
This does not show up in the powershell sqlserver directory

I need to run a powershell command that populates the registered servers list. there are at least 30 servers that i need to register - hence powershell is a better option to do the registration. 


Any help would be grateful to fix this?

 

 

  • I have the same issue. The reason that this is happening is that SSMS v20 creates the file RegSrvr17.xml for storing the registered server groups and the cmdlet created the file RegSrvr16.xml. You can find these files at the path C:\Users\m.ntallaris(user name)\AppData\Roaming\Microsoft\SQL Server Management Studio. Unfortunately I have not find a solution to this, still searching though. An interesting fact if you install and use SSMS 19 will work perfectly, but if you install and use SSMS 18 no because this uses RegSrvr.xml. Another interesting fact is that if you search the release logs of SSMS 18 Microsoft point out that it has now this file in the AppData folder and not as a .bin (as the previous versions had) in order to all versions to have easy access to the registered servers, but in very next version Microsoft chose to rename the file...

4 Replies

  • Mario071510's avatar
    Mario071510
    Copper Contributor
    I have the same issue. The reason that this is happening is that SSMS v20 creates the file RegSrvr17.xml for storing the registered server groups and the cmdlet created the file RegSrvr16.xml. You can find these files at the path C:\Users\m.ntallaris(user name)\AppData\Roaming\Microsoft\SQL Server Management Studio. Unfortunately I have not find a solution to this, still searching though. An interesting fact if you install and use SSMS 19 will work perfectly, but if you install and use SSMS 18 no because this uses RegSrvr.xml. Another interesting fact is that if you search the release logs of SSMS 18 Microsoft point out that it has now this file in the AppData folder and not as a .bin (as the previous versions had) in order to all versions to have easy access to the registered servers, but in very next version Microsoft chose to rename the file...
    • UnknownSQLDBA's avatar
      UnknownSQLDBA
      Copper Contributor
      Thanks for this 🙂
      I renamed RegSrvr16.xml to RegSrvr17.xml and now my SSMS v20 is populated
      A simple workaround - works for me.

    • UnknownSQLDBA's avatar
      UnknownSQLDBA
      Copper Contributor

      I tried that as well.
      Add-DbaRegServer -ServerName SQLName1
      Get-DbaRegisteredServer -- shows me that it is added

      But when i go into SSMS, its not in the registered list. (restarted and refreshed ssms as well)

Resources