commands

^

Get-DbaRegServerGroup

Author Tony Wilhelm (@tonywsql)
Availability Windows, Linux, macOS

 

Synopsis

Gets list of Server Groups objects stored in SQL Server Central Management Server (CMS).

Description

Returns an array of Server Groups found in the CMS.

Syntax

Get-DbaRegServerGroup
    [[-SqlInstance] <DbaInstanceParameter[]>]
    [[-SqlCredential] <PSCredential>]
    [[-Group] <Object[]>]
    [[-ExcludeGroup] <Object[]>]
    [[-Id] <Int32[]>]
    [-EnableException]
    [<CommonParameters>]

 

Examples

 

Example: 1
PS C:\> Get-DbaRegServerGroup -SqlInstance sqlserver2014a

Gets the top level groups from the CMS on sqlserver2014a, using Windows Credentials.

Example: 2
PS C:\> Get-DbaRegServerGroup -SqlInstance sqlserver2014a -SqlCredential $credential

Gets the top level groups from the CMS on sqlserver2014a, using alternative credentials to authenticate to the server.

Example: 3
PS C:\> Get-DbaRegServerGroup -SqlInstance sqlserver2014a -Group HR, Accounting

Gets the HR and Accounting groups from the CMS on sqlserver2014a.

Example: 4
PS C:\> Get-DbaRegServerGroup -SqlInstance sqlserver2014a -Group HR\Development

Returns the sub-group Development of the HR group from the CMS on sqlserver2014a.

Optional Parameters

-SqlInstance

The target SQL Server instance or instances.

Alias
Required False
Pipeline true (ByValue)
Default Value
-SqlCredential

Login to the target instance using alternative credentials. Accepts PowerShell credentials (Get-Credential). Windows Authentication, SQL Server Authentication, Active Directory - Password, and Active Directory - Integrated are all supported. For MFA support, please use Connect-DbaInstance.

Alias
Required False
Pipeline false
Default Value
-Group

Specifies one or more groups to include from SQL Server Central Management Server.

Alias
Required False
Pipeline false
Default Value
-ExcludeGroup

Specifies one or more Central Management Server groups to exclude.

Alias
Required False
Pipeline false
Default Value
-Id

Get group by Id(s). This parameter only works if the group has a registered server in it.

Alias
Required False
Pipeline false
Default Value
-EnableException

By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message. This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting. Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.

Alias
Required False
Pipeline false
Default Value False

 

Want to see the source code for this command? Check out Get-DbaRegServerGroup on GitHub.
Want to see the Bill Of Health for this command? Check out Get-DbaRegServerGroup.