Get-CmsHostsis 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.
This example will connect to
srv-mycms-01and 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.