October 26, 2023 at 2:14 pm
I have an old and a new CMS server. I am trying to keep the CMS groups and registrations in sync. I am trying this with dbatools.
Here is what I have, error at bottom....
Remove-DbaRegServer -sqlinstance (my new cms server) -Confirm:$false
Remove-DbaRegServerGroup -sqlinstance (my new cms server) -Confirm:$false
Export-DbaRegServer -SqlInstance (old cms server) -FilePath "c:\listofCMSgroupsAndServers.regsrvr" -Overwrite
Import-DbaRegServer -SqlInstance (my new cms server) -Path "c:\listofCMSgroupsAndServers.regsrvr"
PS C:\tools> Import-DbaRegServer -SqlInstance (my new cms server) -Path "c:\listofCMSgroupsAndServers.regsrvr"
WARNING: [10:11:38][Import-DbaRegServer] Failure attempting to import c:\listofCMSgroupsAndServers.regsrvr to (new cms server) | You cannot add a shared regi
stered server with the same name as the Configuration Server.
October 26, 2023 at 3:30 pm
The error tells you exactly what is wrong. The CMS can't be in the registered server list. You will need to edit the CMS list to remove the "my new cms server" from the list of registered servers.
If you don't want to edit the old CMS, I am pretty sure that a regsrvr file is a plain text file and you can open it in a tool like notepad and just edit out the new cms server from the list. Been a while since I worked with setting up a CMS and worked with regsrvr files, so I MAY be mistaken on that and you may need to remove it from the old CMS, export, then add it back in.
The above is all just my opinion on what you should do.
As with all advice you find on a random internet forum - you shouldn't blindly follow it. Always test on a test server to see if there is negative side effects before making changes to live!
I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply