Get-SCOMAlert

Get-SCOMAlert

Gets Operations Manager alerts.

構文

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

Parameter Set: FromAlertDefault
Get-SCOMAlert [[-Instance] <EnterpriseManagementObject[]> ] [[-LastModifiedBy] <String[]> ] [[-Name] <String[]> ] [[-Owner] <String[]> ] [[-ResolutionState] <Int32[]> ] [[-ResolvedBy] <String[]> ] [[-HealthState] <String[]> ] [[-Priority] <String[]> ] [[-Severity] <String[]> ] [-ComputerName <String[]> ] [-Credential <PSCredential> ] [-SCSession <Connection[]> ] [ <CommonParameters>]

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

Parameter Set: FromCriteria
Get-SCOMAlert [[-Criteria] <String> ] [-ComputerName <String[]> ] [-Credential <PSCredential> ] [-SCSession <Connection[]> ] [ <CommonParameters>]

詳細説明

The Get-SCOMAlert cmdlet gets one or more alerts. An alert is an indication of a significant event that requires your attention. Rules and monitors can generate alerts.

パラメーター

-ComputerName<String[]>

Specifies an array of names of 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 (.).

The System Center Data Access service must be running on the computer. If you do not specify a computer, the cmdlet uses the computer for the current management group connection.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

true (ByValue)

ワイルドカード文字を許可する

false

-Credential<PSCredential>

Specifies a PSCredential object for the management group connection. To obtain a PSCredential object, use the Get-Credential cmdlet. For more information, type Get-Help Get-Credential.

If you specify a computer in the ComputerName parameter, use an account that has access to that computer. The default is the current user.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

true (ByValue)

ワイルドカード文字を許可する

false

-Criteria<String>

Specifies the criteria XML that indicates how to filter alerts. Criteria can filter on particular rules or monitors, or properties of the alert, but cannot filter on classes or groups.

エイリアス

なし

必須?

false

位置は?

10

既定値

なし

パイプライン入力を許可する

true (ByValue)

ワイルドカード文字を許可する

false

-HealthState<String[]>

Specifies an array of health states. Valid values are: critical (red), warning (yellow), healthy (green).

エイリアス

なし

必須?

false

位置は?

7

既定値

なし

パイプライン入力を許可する

true (ByValue)

ワイルドカード文字を許可する

false

-Id<Guid[]>

Specifies an array of GUIDs of alert objects. To get the Id of an alert, type "Get-SCOMAlert | Format-Table Name, Id".

エイリアス

なし

必須?

true

位置は?

1

既定値

なし

パイプライン入力を許可する

true (ByValue)

ワイルドカード文字を許可する

false

-Instance<EnterpriseManagementObject[]>

Specifies an array of class instance objects. This parameter also accepts group objects. To obtain a class instance object, use the Get-SCOMClassInstance cmdlet. For more information, type Get-Help Get-SCOMClassInstance.

エイリアス

なし

必須?

false

位置は?

1

既定値

なし

パイプライン入力を許可する

true (ByValue)

ワイルドカード文字を許可する

false

-LastModifiedBy<String[]>

Specifies an array of user names. The cmdlet get the alerts if the last user that edited the alert matches a user name that you specify.

エイリアス

なし

必須?

false

位置は?

2

既定値

なし

パイプライン入力を許可する

true (ByValue)

ワイルドカード文字を許可する

true

-Name<String[]>

Specifies an array of alert names. The cmdlet get the alerts that match the alert names that you specify.

エイリアス

なし

必須?

false

位置は?

3

既定値

なし

パイプライン入力を許可する

true (ByValue)

ワイルドカード文字を許可する

true

-Owner<String[]>

Specifies an array of user names. The cmdlet gets an alert if the owner of an alert matches a user name that you specify.

エイリアス

なし

必須?

false

位置は?

4

既定値

なし

パイプライン入力を許可する

true (ByValue)

ワイルドカード文字を許可する

true

-Priority<String[]>

Specifies an array of alert prioirty levels. Valid values are:
-- Low
-- Medium
-- High

エイリアス

なし

必須?

false

位置は?

8

既定値

なし

パイプライン入力を許可する

true (ByValue)

ワイルドカード文字を許可する

false

-ResolutionState<Int32[]>

Specifies an array of resolution state IDs.

When an alert is generated, its resolution state is New. Operators can change the resolution state for a new alert to Closed or to a custom resolution state that an administrator has created for the management group. The ID for New is 0 and the ID for Closed is 255. You can assign custom resolution states any value from 2 through 254.

エイリアス

なし

必須?

false

位置は?

5

既定値

なし

パイプライン入力を許可する

true (ByValue)

ワイルドカード文字を許可する

true

-ResolvedBy<String[]>

Specifies an array of user names. The cmdlet get the alerts if the user that resolved the alert matches a user name that you specify.

エイリアス

なし

必須?

false

位置は?

6

既定値

なし

パイプライン入力を許可する

true (ByValue)

ワイルドカード文字を許可する

true

-SCSession<Connection[]>

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

A connection object represents a connection to a management server. The default is the current management group connection.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

true (ByValue)

ワイルドカード文字を許可する

false

-Severity<String[]>

Specifies an array of severity values of alerts. Valid values are:
-- Information
-- Warning
-- Critical

エイリアス

なし

必須?

false

位置は?

9

既定値

なし

パイプライン入力を許可する

true (ByValue)

ワイルドカード文字を許可する

false

<CommonParameters>

このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。

入力

入力型は、コマンドレットにパイプできるオブジェクトの型です。

出力

出力型は、コマンドレットによって生成されるオブジェクトの型です。

Example 1: Get all new alerts

This command gets all alerts that have a resolution state of zero (new alerts).

PS C:\> Get-SCOMAlert -ResolutionState 0

Example 2: Get alerts by using a custom field

This command gets all alerts that have a value of TestServer in the CustomField1 property.

PS C:\> Get-SCOMAlert | where {$_.CustomField1 -eq "TestServer"}

Example 3: Get alerts and suppress error messages

This example gets alerts and suppresses error messages for the class instances that do not match the criteria of the command.

The first command stores the value of the $ErrorActionPreference variable in the $OrigionalErrorAction variable.

The second command sets the value of the $ErrorActionPreference variable to SilentlyContinue. By setting the value of the $ErrorActionPreference variable to SilentlyContinue, class instances that do not have matching task results continue to run and not show an error.

The third command gets all classes with health in their name and passes the class objects to the Get-SCOMClassInstance cmdlet by using the pipeline operator. The Get-SCOMClassInstance gets the class instances for each class object and passes each of the class instance objects to the Get-SCOMAlert cmdlet. The Get-SCOMAlert cmdlet returns the alerts that have a resolution state from 5 through 200, inclusive, for each class instance.

The fourth command sets the value for the $ErrorActionPreference variable back to the value stored in the $OrigionalErrorAction variable.

PS C:\> $OriginalErrorAction = $ErrorActionPreference
PS C:\> $ErrorActionPreference = "SilentlyContinue"
PS C:\> Get-SCOMClass -Name "*health*" | Get-SCOMClassInstance | Get-SCOMAlert -ResolutionState (5..200)
PS C:\> $ErrorActionPreference = $OriginalErrorAction

Example 4: Get an alert by using the ID

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

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

関連トピック

Get-SCOMClassInstance

Set-SCOMAlert

Resolve-SCOMAlert