Central Management Servers into Powershell

  • Hi,

    I added my local instance into Central Management Servers using SSMS.
    However when I run this command in PowerShell I get an empty result set:    dir "SQLSERVER:\SQLRegistration\Central Management Server Group\"
    Any ideas why that is? :/

  • oskargunn - Monday, February 19, 2018 8:55 AM

    Hi,

    I added my local instance into Central Management Servers using SSMS.
    However when I run this command in PowerShell I get an empty result set:    dir "SQLSERVER:\SQLRegistration\Central Management Server Group\"
    Any ideas why that is? :/

    I would guess your instance is listed under the Central Management Servers. Did you register a Central Management Server - and then create other servers, groups under the Registered Central Management Server? It would look like the following screenshot where DB01 is the registered server with the Dev Servers, Prod Servers and Test servers listed under the registered server.:
    Registered Servers vs Central Management Servers

    Powershell gets the list from sysmanagement_shared_registered_servers_internal (and sysmanagement_shared_server_groups_internal) in the msdb database). You can query those to see if there are any servers registered. Most likely there are no servers listed if you have nothing in Powershell.

    Sue

Viewing 2 posts - 1 through 1 (of 1 total)

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