Archive

Archive for the ‘Central Management Server’ Category

Query the Central Management Server List

May 26, 2015 Leave a comment

USE [msdb]
GO
SELECT    g.[name] AS [Group],
        s.[name] AS [SQLAlias],
        s.[server_name] AS [SQLInstance],
        s.[description] AS [Description]
FROM    [dbo].[sysmanagement_shared_server_groups_internal] g

LEFT JOIN [dbo].[sysmanagement_shared_registered_servers_internal] s
    ON    g.[server_group_id] = s.[server_group_id]
WHERE    g.[server_type] = 0
    AND    g.[is_system_object] = 0
ORDER BY [Group], [SQLAlias]