New-SqlMonitorGroup
Published 14 February 2023
Creates a new group.
Syntax
New-SqlMonitorGroup [-Name] <string> [[-Groups] <Group[]>] [[-BaseMonitors] <BaseMonitor[]>] [<CommonParameters>]
Description
Creates a new group on the root or provided group.
Parameters
-Name
<String>
The name for the new group
Aliases | None |
Required? | true |
Position? | 1 |
Default Value | None |
Accept Pipeline Input | False |
Accept Wildcard Characters | false |
-Groups
<Group[]>
The group(s) to add this new group to. Will create a new main group if no value provided. Optional
Aliases | None |
Required? | false |
Position? | 2 |
Default Value | None |
Accept Pipeline Input | True (ByValue) |
Accept Wildcard Characters | false |
-BaseMonitors
<BaseMonitor[]>
The base monitor(s) to add this new group to. Optional. Ignored if Groups is specified.
Aliases | None |
Required? | false |
Position? | 3 |
Default Value | None |
Accept Pipeline Input | True (ByValue) |
Accept Wildcard Characters | false |
-ProgressAction
<ActionPreference>
{{ Fill ProgressAction Description }}
Aliases | None |
Required? | false |
Position? | named |
Default Value | None |
Accept Pipeline Input | False |
Accept Wildcard Characters | false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see http://technet.microsoft.com/en-us/library/hh847884.aspx.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
-
[string] Name. The name for the new group
-
[Group[]] Groups (Optional). The group to place the new group into.
-
[BaseMonitor[]] BaseMonitors (Optional). Only takes effect if Groups is not specified. The base monitors to create the group on.
Return values
The output type is the type of the objects that the cmdlet emits.
-
[Group[]] The resulting groups created.
Examples
-------------------------- EXAMPLE 1 --------------------------
$Group = New-SqlMonitorGroup "TestGroup"
-------------------------- EXAMPLE 2 --------------------------
$ChildGroup = New-SqlMonitorGroup "Parent" | New-SqlMonitorGroup "Child" This will create a new group called "Parent" with a child group called "Child" on each base monitor
-------------------------- EXAMPLE 3 --------------------------
$ParentGroup = Get-SqlMonitorGroup "Parent" $ChildGroup = New-SqlMonitorGroup "Parent" $ParentGroup
-------------------------- EXAMPLE 4 --------------------------
$Group = Get-SqlMonitorBaseMonitor | Where-Object -Property Name -eq "localhost" | New-SqlMonitorGroup "OnLocal"