Sql-server – Execute Stored Procedure against CMS from within a SQL Server Agent job

central-management-serverquerysql servert-sql

Is it possible to execute a stored procedure (or any T-SQL) against a Central Management Server (CMS) via a SQL Agent job?

The idea here is to exercise the CMS to hit all the registered instances with a query (or action), in an unattended (non-SSMS, non-real time) way.

Best Answer

The answer to this is: not possible, however my research lead me to these tables in MSDB which are used to populate the CMS registered servers. These tables can be referenced in your code:

sysmanagement_shared_registered_servers_internal

sysmanagement_shared_server_groups_internal