Remove-CMAlert
Remove-CMAlert
Removes Configuration Manager alerts.
Syntax
Parameter Set: SearchByIdMandatory
Remove-CMAlert -Id <String> [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: SearchByNameMandatory
Remove-CMAlert -Name <String> [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: SearchByValueMandatory
Remove-CMAlert -InputObject <IResultObject> [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]
Detailed Description
The Remove-CMAlert cmdlet removes one or more Microsoft System Center 2012 Configuration Manager alerts.
Parameters
-Force
Removes an alert without prompting you for confirmation.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-Id<String>
Specifies an alert identifier. You can obtain the identifier of an alert by using the Get-Alert cmdlet.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-InputObject<IResultObject>
Specifies a CMAlert object. To obtain a CMAlert object, use the Get-CMAlert cmdlet.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-Name<String>
Specifies an alert name. You can obtain the name of an alert by using Get-CMAlert.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-Confirm
Prompts you for confirmation before running the cmdlet.
Required? |
false |
Position? |
named |
Default Value |
false |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? |
false |
Position? |
named |
Default Value |
false |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1: Remove an alert by using alert ID
This command removes an alert that has the ID16777223.
PS C:\> Remove-CMAlert -Id "16777223"
Example 2: Remove an alert by using alert object variable
In this example, the first command gets a CMAlert object that has the ID 16777221 and stores it in the $AlertObj variable.
The second command removes the alert stored in the $AlertObj variable.
PS C:\> $AlertObj = Get-CMAlert -Id "16777221"
PS C:\> Remove-CMAlert -InputObject $AlertObj