Query All Servers In A CMS Folder

Tracy Boggiano has a Powershell script for querying each SQL Server instance in a Central Management Server folder:

In this post I’m going to share a function (actually two) I use run scripts against multiple instances of SQL servers and run the data into a data table. I use this mainly for a replacement of the CMS feature of running against a folder and to put the data into a DataTable object which I output to a GridView that I can sort and filter any way I want which you can’t do in CMS.

Click through for the script.

Related Posts

Navigating A SQL Server Instance With Powershell

Andy Mallon shows off the drive-based navigation available in the SQL Server Powershell module: I recently noticed that the system objects were missing from my results when I do a Get-ChildItem. I noticed it with views, but then realized that none of the system objects showed up. What gives? I floundered through a quick Google search, […]

Read More

Find And Replace Stored Procedure Code

Jana Sattainathan has to find and replace a lot of code: The database has 100’s of stored procedures (700+ to be somewhat precise) Qualifying stored procedures have these characteristics Procedure name ends with “_del” Procedure has the string “exec” in the code Procedure has the string “sp_execute” in the code This is what needs to […]

Read More

Categories

April 2017
MTWTFSS
« Mar May »
 12
3456789
10111213141516
17181920212223
24252627282930