Share via


Enable-SCOMMonitor

Enables monitors in Operations Manager.

Syntax

Empty (Default)

Enable-SCOMMonitor
    [-Monitor] <ManagementPackMonitor[]>
    [-ManagementPack] <ManagementPack>
    [-Enforce]
    [-PassThru]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

FromGroup

Enable-SCOMMonitor
    [-Monitor] <ManagementPackMonitor[]>
    [[-Group] <MonitoringObject[]>]
    [-ManagementPack] <ManagementPack>
    [-Enforce]
    [-PassThru]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

FromManagementPackClass

Enable-SCOMMonitor
    [-Monitor] <ManagementPackMonitor[]>
    [-Class] <ManagementPackClass[]>
    [-ManagementPack] <ManagementPack>
    [-Enforce]
    [-PassThru]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

FromInstance

Enable-SCOMMonitor
    [-Monitor] <ManagementPackMonitor[]>
    [[-Instance] <MonitoringObject[]>]
    [-ManagementPack] <ManagementPack>
    [-Enforce]
    [-PassThru]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Enable-SCOMMonitor cmdlet enables monitors in System Center 2016 - Operations Manager. In Operations Manager, monitors define logic for determining the health of an object.

Examples

Example 1: Enable a monitor

PS C:\>$MP = Get-SCOMManagementPack -Displayname "My SQL MP Customization" | where {$_.Sealed -eq $False}
PS C:\> $Class = Get-SCOMClass -DisplayName "SQL DB Engine"
PS C:\> $Monitor = Get-SCOMMonitor -DisplayName "*memory*"
PS C:\> Enable-SCOMMonitor -Class $Class -ManagementPack $MP -Monitor $Monitor -Enforce

This example enables an Operations Manager monitor.

The first command uses the Get-SCOMManagementPack cmdlet to get a management pack object, and it stores the result in the variable named $MP.

The second command uses the Get-SCOMClass cmdlet to get a class object, and it stores the result in the variable named $Class.

The third command uses the Get-SCOMMonitor cmdlet to get a monitor object, and it stores the result in the variable named $Monitor.

The fourth command uses the Enable-SCOMMonitor cmdlet to enable the monitor by using the Enforce parameter.

Parameters

-Class

Specifies an array of class objects. For information about how to get a class object, type "Get-Help Get-SCOMClass".

Parameter properties

Type:

ManagementPackClass[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

FromManagementPackClass
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Enforce

Indicates that the cmdlet sets the Enforce property on the override to $True.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:3
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Group

Specifies an array of group objects. For information about how to get a group object, type "Get-Help Get-SCOMGroup".

Parameter properties

Type:

MonitoringObject[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

FromGroup
Position:1
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Instance

Specifies an array of class instance objects. The Instance parameter also accepts group objects as input. For information about how to get a class instance object, type "Get-Help Get-SCOMClassInstance".

Parameter properties

Type:

MonitoringObject[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

FromInstance
Position:1
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-ManagementPack

Specifies one or more management pack objects where you can save the override. If the monitor is in an unsealed management pack, you must save the overrides into the same management pack. For information about how to get a management pack object, type "Get-Help Get-SCOMManagementPack".

Parameter properties

Type:ManagementPack
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Monitor

Specifies an array of monitor objects. For information about how to get a monitor object, type "Get-Help Get-SCOMMonitor".

Parameter properties

Type:

ManagementPackMonitor[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:2
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PassThru

Indicates that the cmdlet creates or modifies an object that a command can use in a pipeline. By default, this cmdlet does not generate any output.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:4
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.