Remove-CMAlertSubscription
Remove-CMAlertSubscription
Removes an alert subscription object.
Syntax
Parameter Set: SearchByIdMandatory
Remove-CMAlertSubscription -Id <String> [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: SearchByNameMandatory
Remove-CMAlertSubscription -Name <String> [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: SearchByValueMandatory
Remove-CMAlertSubscription -InputObject <IResultObject> [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]
Detailed Description
The Remove-CMAlertSubscription cmdlet removes an alert subscription from Microsoft System Center 2012 Configuration Manager.
Parameters
-Force
Removes an alert subscription from Configuration Manager 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 array of identifiers of subscriptions.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-InputObject<IResultObject>
Specifies an alert notification object in Configuration Manager.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-Name<String>
Specifies the name of an alert subscription object.
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 subscription by ID
This example removes an alert subscription by using its ID.
PS C:\> Remove-CMAlertSubscription -Id "16777310"
Example 2: Remove an alert subscription by name
This example removes an alert subscription named Subscription01.
PS C:\> Remove-CMAlertSubscription -Name "Subscription01"
Example 3: Remove an alert subscription by using the output from another cmdlet as input
In this example, the first command gets an alert subscription object that has the ID 16777310 and stores the object in the $SubObj variable.
The second command deletes the alert subscription that is stored in the $SubObj variable.
PS C:\> $SubObj = Get-CMAlertSubscription -Id "16777310"
PS C:\> Remove-CMAlertSubscription -AlertSubscription $SubObj