Share via


Get-SCOMMonitor

[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Get-SCOMMonitor

Gets the specified monitors.

Syntax

Parameter Set: Empty
Get-SCOMMonitor [-ComputerName <String> ] [-Credential <PSCredential> ] [-SCSession <Connection> ] [ <CommonParameters>]

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

Parameter Set: FromManagementPack
Get-SCOMMonitor [-ManagementPack] <ManagementPack> [-ComputerName <String> ] [-Credential <PSCredential> ] [-SCSession <Connection> ] [ <CommonParameters>]

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

Parameter Set: FromMonitoringDisplayRuleName
Get-SCOMMonitor [-DisplayName] <String> [-ComputerName <String> ] [-Credential <PSCredential> ] [-SCSession <Connection> ] [ <CommonParameters>]

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

Parameter Set: FromMonitorName
Get-SCOMMonitor [-Name] <String> [-ComputerName <String> ] [-Credential <PSCredential> ] [-SCSession <Connection> ] [ <CommonParameters>]

Detailed Description

The Get-SCOMMonitor cmdlet gets the specified monitors.

Parameters

-ComputerName<String>

Specifies the name of a computer to establish a connection with. The computer must be running the System Center Data Access Service. The default value is the computer for the current management group connection. Valid formats include a NetBIOS name, an IP address, or a fully qualified domain name. To specify the local computer, type the computer name, "localhost", or a dot (.).

Aliases

none

Required?

false

Position?

named

Default Value

localhost

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-Credential<PSCredential>

Specifies a user account under which the management group connection will run. The default is the current user. Type a user name, such as "User01", "Domain01\User01", or "User@Domain.com", or enter a PSCredential object, such as one returned by the Get-Credential cmdlet. When you type a user name, you will be prompted for a password. For more information, type Get-Help Get-Credential.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-DisplayName<String>

Specifies the display name of an object. This parameter takes one or more strings and will look for matches in the DisplayName property of the given objects that this cmdlet works with. DisplayName values may vary depending on which localized management packs are imported into the management group and the locale of the user running Windows PowerShell.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

true

-Id<Guid>

Retrieves the monitor with the specified GUID.

The GUID is stored in the Id property of the object that represents an SCOMMonitor. To get the GUID of a monitor, type "Get-SCOMMonitor | Format-Table DisplayName, Id".

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-Instance<EnterpriseManagementObject>

Retrieves monitors for the specified class instance object. Enter a variable that represents the class instance, or type a command that gets the class instance. This parameter also accepts group objects.

For information about how to get a class instance object, type Get-Help Get-SCOMClassInstance.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-ManagementPack<ManagementPack>

Retrieves monitors for one or more specified management pack objects. Enter a variable that represents the management packs, or type a command that gets the management packs.

For information about how to get a management pack object, type Get-Help Get-SCOMManagementPack.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-Name<String>

Specifies the name of an object.

This parameter takes one or more strings and will look for matches in the Name property of the given objects that this cmdlet works with.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

true

-Recurse

Aliases

none

Required?

false

Position?

2

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-SCSession<Connection>

Specifies a connection to a management server. The default is the current management group connection. Specify a Management group connection object, such as one returned by the Get-SCOMManagementGroupConnection cmdlet.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-Target<ManagementPackClass>

Retrieves monitors for one or more target class objects. Enter a variable that represents the target classes, or type a command that gets the target classes.

For information about how to get a class object, type Get-Help Get-SCOMClass.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters

Examples

-------------------------- EXAMPLE 1 --------------------------

Description

-----------

This command gets all monitors that have a name beginning with "System.Health".

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

-------------------------- EXAMPLE 2 --------------------------

Description

-----------

This command gets all monitors that have a display name containing "Performance".

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

-------------------------- EXAMPLE 3 --------------------------

Description

-----------

This command gets the management pack with the display name of "System Center Core Library" and then uses the pipeline operator (|) to pass the management pack object to the Get-SCOMMonitor cmdlet which gets all monitors for the management pack object.

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

-------------------------- EXAMPLE 4 --------------------------

Description

-----------

The first command gets the path to a management pack file and saves it in the $MPFile variable.

The second command uses the ManagementPack parameter to get the monitors contained in the management pack stored in the $MPFile variable.

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

-------------------------- EXAMPLE 5 --------------------------

Description

-----------

The first command gets all classes with "health" in their display name and uses the pipeline operator (|) to pass the class objects to the Get-SCOMClassInstance cmdlet which 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.

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

-------------------------- EXAMPLE 6 --------------------------

Description

-----------

This command gets the monitors with target classes that contain "health" in their display name.

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

-------------------------- EXAMPLE 7 --------------------------

Description

-----------

This command gets the monitor that has an Id of 7413b06b-a95b-4ae3-98f2-dac9ff76dabd.

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

Get-SCOMClassInstance

Get-SCOMManagementPack