Share via


Get-SCOMMonitor

Retrieves monitors in Operations Manager.

Syntax

Empty (Default)

Get-SCOMMonitor
    [-SCSession <Connection[]>]
    [-ComputerName <String[]>]
    [-Credential <PSCredential>]
    [<CommonParameters>]

FromMonitoringDisplayRuleName

Get-SCOMMonitor
    [-DisplayName] <String[]>
    [-SCSession <Connection[]>]
    [-ComputerName <String[]>]
    [-Credential <PSCredential>]
    [<CommonParameters>]

FromMonitoringRuleId

Get-SCOMMonitor
    -Id <Guid[]>
    [-SCSession <Connection[]>]
    [-ComputerName <String[]>]
    [-Credential <PSCredential>]
    [<CommonParameters>]

FromEMO

Get-SCOMMonitor
    [-Instance] <EnterpriseManagementObject[]>
    [-Recurse]
    [-SCSession <Connection[]>]
    [-ComputerName <String[]>]
    [-Credential <PSCredential>]
    [<CommonParameters>]

FromManagementPackClass

Get-SCOMMonitor
    [-Target] <ManagementPackClass[]>
    [-Recurse]
    [-SCSession <Connection[]>]
    [-ComputerName <String[]>]
    [-Credential <PSCredential>]
    [<CommonParameters>]

FromManagementPack

Get-SCOMMonitor
    [-ManagementPack] <ManagementPack[]>
    [-SCSession <Connection[]>]
    [-ComputerName <String[]>]
    [-Credential <PSCredential>]
    [<CommonParameters>]

FromMonitorName

Get-SCOMMonitor
    -Name <String[]>
    [-SCSession <Connection[]>]
    [-ComputerName <String[]>]
    [-Credential <PSCredential>]
    [<CommonParameters>]

Description

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

Examples

Example 1: Retrieve a monitor by using a name

PS C:\>Get-SCOMMonitor -Name "System.Health*"

This command retrieves all monitors whose names begin with the string "System.Health".

Example 2: Retrieve a monitor by using a display name

PS C:\>Get-SCOMMonitor -DisplayName "*Performance*"

This command retrieves all monitors whose display names contain the string "Performance".

Example 3: Retrieve monitors for a management pack

PS C:\>Get-SCOMManagementPack -DisplayName "System Center Core Library" | Get-SCOMMonitor

This command retrieves the management pack that has the display name of System Center Core Library, and then passes the management pack object to the Get-SCOMMonitor cmdlet by using the pipeline operator (|). The Get-SCOMMonitor cmdlet gets all monitors for the management pack object.

Example 4: Retrieve monitors from a management pack

PS C:\>$MPFile = "C:\Program Files\System Center Operations Manager 2007\Microsoft.SystemCenter.2007.mp"
PS C:\> Get-SCOMMonitor -ManagementPack $MPFile

This example retrieves monitors in a management pack.

The first command gets the path to a management pack file and stores the value in the variable named $MPFile.

The second command uses the Get-SCOMMonitor cmdlet with the ManagementPack parameter to get the monitors from the management pack.

Example 5: Retrieve monitors by display name

PS C:\>$Instances = Get-SCOMClass -DisplayName "*health*" | Get-SCOMClassInstance
PS C:\> Get-SCOMMonitor -Instance $Instances

This example retrieves monitors by display name.

The first command gets all classes that contain "health" in their display names, and then uses the pipeline operator (|) to pass the class objects to the Get-SCOMClassInstance cmdlet. The Get-SCOMClassInstance cmdlet gets the instance for each class, and then stores the results in the $Instances variable.

The second command gets the monitors for the class instances stored in the $Instances variable.

Example 6: Retrieve monitors by using a target class

PS C:\>Get-SCOMMonitor -Target (Get-SCOMClass -DisplayName *health*)

This example retrieves monitors by using a target class.

This command gets the monitors that have target classes that include "health" in their display names.

Example 7: Retrieve a monitor by using an ID

PS C:\>Get-SCOMMonitor -Id 7413b06b-a95b-4ae3-98f2-dac9ff76dabd

This command retrieves the monitor that has the ID 7413b06b-a95b-4ae3-98f2-dac9ff76dabd.

Parameters

-ComputerName

Specifies an array of names of computers. The cmdlet establishes temporary connections with management groups for these computers. You can use NetBIOS names, IP addresses, or fully qualified domain names (FQDNs). To specify the local computer, type the computer name, localhost, or a dot (.).

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

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

-Credential

Specifies a PSCredential object for the computer or computers that the ComputerName parameter specifies. The management group connection runs under this credential. To obtain a PSCredential object, use the Get-Credential cmdlet. For more information, type "Get-Help Get-Credential".

Parameter properties

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

Parameter sets

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

-DisplayName

Specifies an array of display name objects. Values of the DisplayName parameter may vary depending on which localized management packs a user imports into the management group and the locale of the user who is running Windows PowerShell.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:True
DontShow:False

Parameter sets

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

-Id

Specifies an array of unique identifiers for monitors.

The SCOMMonitor object stores the GUID in the Id property of the object. For more information, type "Get-SCOMMonitor | Format-Table DisplayName, Id".

Parameter properties

Type:

Guid[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

FromMonitoringRuleId
Position:Named
Mandatory:True
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:

EnterpriseManagementObject[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

FromEMO
Position:1
Mandatory:True
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 an unsealed management pack contains the monitor, save the override in 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

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

-Name

Specifies an array of names of an object.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:True
DontShow:False

Parameter sets

FromMonitorName
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Recurse

Indicates that the cmdlet searches recursively.

Parameter properties

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

Parameter sets

FromEMO
Position:2
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
FromManagementPackClass
Position:2
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SCSession

Specifies an array of Connection objects. To obtain a Connection object, use the Get-SCManagementGroupConnection cmdlet.

Parameter properties

Type:

Connection[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

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

-Target

Specifies an array of monitors for one or more target 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:True
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.