Registered servers

  • Hello - If someone creates the registered servers, can I use them to save time not to again add them one by one?

    Thanks.

  • SQL-DBA-01 - Monday, May 14, 2018 1:20 PM

    Hello - If someone creates the registered servers, can I use them to save time not to again add them one by one?

    Were they created in a central management server?  if so, then yes.  If however they were created as a local server group, then no.
    In that case, they can export them and you can import them.

    Michael L John
    If you assassinate a DBA, would you pull a trigger?
    To properly post on a forum:
    http://www.sqlservercentral.com/articles/61537/

  • If you're referring to SSMS, there is an export/import option for registered servers. 
    View > Registered Servers
    right click the server/group
    Tasks > Import/Export

  • Hi Guys, I did an Export and Import and it is working fine. Thanks

    Thanks.

  • Is running queries against registered servers preferred specially in this period when you have Powershell to run and get the results?

    What are the demerits of using Registered servers?

    Thanks.

  • SQL-DBA-01 - Tuesday, May 15, 2018 9:41 AM

    Is running queries against registered servers preferred specially in this period when you have Powershell to run and get the results?

    What are the demerits of using Registered servers?

    There isn't anything inherently wring with using registered servers - many people use it. It gives you a "one-stop" tool to get to any of the servers, you can organize them into groups such as Development, Staging, Preprod, Testing, Production or whatever the environments are or what works best for you. It can make things a lot easier to compare a table, stored procedure or other objects between things like a development database and a production database. It can make it hard to "forget" about some instance you don't worry about too much when you see it in your list of servers. When I've had a lot of instances and databases, sometimes I forget which instance has a certain database and it's pretty easy to just click on a couple of the servers to expand the databases and see what ones are where. Importing someone else's registered servers file can really help for someone who is new to the company or environment. If I was in one database working on some script and someone yells about some other databases, it's pretty easy to jump over to that other database. Lots of things like that.
    Just think about whatever you do in SSMS - and then think about doing the same in Powershell. They aren't really the same. And they wouldn't be as Powershell isn't a tool designed solely to assist with database management, administration. SSMS is though. I can't imagine doing the things I mentioned above with Powershell. You'd probably need to keep some spreadsheet of all the instances and the databases with a breakdown by environments.
    One thing that can be problematic is when people forget which database or environment they are connected to. And people getting so dependent on the GUI that they don't know how to do the same using t-sql.

    Sue

  • PowerShell and Registered Servers are a great combination. 

    Problem:  Run a PowerShell script on every SQL Server listed in any of your registered Central Management Servers.
    # Get distinct list of all registered servers
    gci 'SQLSERVER:\SqlRegistration\Central Management Server Group' -Recurse | ?{$_.ServerType -eq 'DatabaseEngine' } |
    Select-Object -Property ServerName -Unique | %{
      # Get a reference to the server
      $server = New-Object Microsoft.SqlServer.Management.Smo.Server $_.ServerName;

    Assuming the registered group names follow some useful naming standard, it would be fairly easy to filter out only Dev servers or Test servers.

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply