Powershell And CMS

Mark Wilkinson loves Powershell and he loves Central Management Servers and he loves combining the two:

Get-CmsHosts is a function I wrote as part of a custom PowerShell module we maintain internally at my employer. It is simple to use, but is the base of most automation projects I work on.

Simple Example

PS> Get-CmsHosts -SqlInstance 'srv-' -CmsInstance srv-mycms-01

This example will connect to srv-mycms-01 and return a distinct list of instance host names registered with that CMS server that start with the string srv-. This output can then be piped to other commands:

Read on for more examples and details, and then grab the script at the end of Mark’s post.

Related Posts

Log Shipping Tests With dbachecks

Sander Stad has a bonus post in his log shipping series: We want everyone to know about this module. Chrissy LeMaire reached out to me and asked if I could write some tests for the log shipping part and I did. Because I wrote the log shipping commands for dbatools I was excited about creating […]

Read More

Digging Into dbachecks

Rob Sewell walks us through dbachecks configuration: So I can import this configuration and run my checks with it any time I like. This means that I can create many different test configurations for my many different environment or estate configurations. Yes, I know “good/best practice” says we should use the same configuration for all […]

Read More

Categories

September 2017
MTWTFSS
« Aug Oct »
 123
45678910
11121314151617
18192021222324
252627282930