Set-SCOMAlert
Changes the properties of alerts.
Syntax
Set-SCOMAlert
-Alert <MonitoringAlert[]>
[-Connector <MonitoringConnector>]
[[-CustomField1] <String>]
[[-CustomField2] <String>]
[[-CustomField3] <String>]
[[-CustomField4] <String>]
[[-CustomField5] <String>]
[[-CustomField6] <String>]
[[-CustomField7] <String>]
[[-CustomField8] <String>]
[[-CustomField9] <String>]
[[-CustomField10] <String>]
[[-ResolutionState] <Byte>]
[[-Owner] <String>]
[[-TicketId] <String>]
[-TfsWorkItemId <String>]
[-TfsWorkItemOwner <String>]
[[-Comment] <String>]
[-PassThru]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Set-SCOMAlert cmdlet changes the properties of one or more alerts. You can use the cmdlet to resolve an alert by setting the ResolutionState parameter to 255 (Closed).
Examples
Example 1: Close alerts by using the resolution state
PS C:\>Get-SCOMAlert -ResolutionState 15 | Set-SCOMAlert -ResolutionState 255
This command gets all alerts with a resolution state of 15 and then passes the alert objects to the Set-SCOMAlert cmdlet by using the pipe operator. The Set-SCOMAlert cmdlet closes the alert by setting the resolution state to 255.
Example 2: Change the properties of alerts
PS C:\>Get-SCOMAlert -Name "Failed Accessing Windows Event Log" | Set-SCOMAlert -Owner "CONTOSO\Isabel" -CustomField1 "Root Cause - Permissions"
This command gets all alerts named "Failed Accessing Windows Event Log" and then passes the alert objects to the Set-SCOMAlert cmdlet by using the pipe operator. The Set-SCOMAlert cmdlet changes the owner of the alert and sets the value for CustomField1.
Parameters
-Alert
Specifies an array of MonitoringAlert objects. To obtain a MonitoringAlert object, use the Get-SCOMAlert cmdlet.
Type: | MonitoringAlert[] |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Comment
Specifies a comment to add to the resolved alert.
Type: | String |
Position: | 1 |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Connector
Specifies a MonitoringConnector object. This parameter specifies the connector that generated the connection string. To obtain a MonitoringConnector object, use the Get-SCOMConnector cmdlet.
Type: | MonitoringConnector |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-CustomField1
Specifies information to add to the CustomField1 property of the alert.
Type: | String |
Position: | 2 |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-CustomField10
Specifies information to add to the CustomField10 property of the alert.
Type: | String |
Position: | 11 |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-CustomField2
Specifies information to add to the CustomField2 property of the alert.
Type: | String |
Position: | 3 |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-CustomField3
Specifies information to add to the CustomField3 property of the alert.
Type: | String |
Position: | 4 |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-CustomField4
Specifies information to add to the CustomField4 property of the alert.
Type: | String |
Position: | 5 |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-CustomField5
Specifies information to add to the CustomField5 property of the alert.
Type: | String |
Position: | 6 |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-CustomField6
Specifies information to add to the CustomField6 property of the alert.
Type: | String |
Position: | 7 |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-CustomField7
Specifies information to add to the CustomField7 property of the alert.
Type: | String |
Position: | 8 |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-CustomField8
Specifies information to add to the CustomField8 property of the alert.
Type: | String |
Position: | 9 |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-CustomField9
Specifies information to add to the CustomField9 property of the alert.
Type: | String |
Position: | 10 |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Owner
Specifies the user name of the owner of the alert.
Type: | String |
Position: | 13 |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-PassThru
Indicates that the cmdlet creates or modifies an object that a command can use in the pipeline. By default, this cmdlet does not generate any output.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ResolutionState
Specifies a resolution state Id.
When Operations Manager generates an alert, its resolution state is New. You 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.
Type: | Byte |
Position: | 12 |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-TfsWorkItemId
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-TfsWorkItemOwner
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-TicketId
Specifies a value for the TicketId property for the alert.
Type: | String |
Position: | 14 |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |