﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2008 / SQL Server 2008 - General  / Run A query on Multiple servers using CMS / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sat, 25 May 2013 12:21:10 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Run A query on Multiple servers using CMS</title><link>http://www.sqlservercentral.com/Forums/Topic1401212-391-1.aspx</link><description>Those requirements are a bit vague. Are you running a select statement? An update? What will your CSV look like? Here is some boilerplate PowerShell code to help you get you started interacting with your CMS.[u][code="plain"]$serverGroupPath = 'SQLSERVER:\SQLRegistration\Central Management Server Group\&amp;lt;GroupName&amp;gt;\'$instanceNameList = dir $serverGroupPath -recurse | where-object { $_.Mode.Equals("-") } | select-object Name -Uniqueforeach($instanceName in $instanceNameList) {     # do something against each server here}[/code][/u]</description><pubDate>Mon, 31 Dec 2012 12:10:00 GMT</pubDate><dc:creator>opc.three</dc:creator></item><item><title>Run A query on Multiple servers using CMS</title><link>http://www.sqlservercentral.com/Forums/Topic1401212-391-1.aspx</link><description>Hi ,I want to run a query on Multiple servers i am using CMS to run it on multiple on server.Now i want to automate this through job,powershell,sqlcmd ...and the result should export to CSV.Pls help.</description><pubDate>Sat, 29 Dec 2012 16:55:05 GMT</pubDate><dc:creator>best_yunus</dc:creator></item></channel></rss>