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
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 stringsrv-
. 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.