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 SP1 Configuration Manager.

Parameters

-Force

Forces the command to run without asking for user confirmation.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Id<String>

Specifies the ID of an alert subscription.

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.

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 command removes an alert subscription by using its ID.

PS C:\> Remove-CMAlertSubscription -Id "16777310"

Example 2: Remove an alert subscription by name

This command 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

The first command gets an alert subscription object that has the ID 16777310, and then stores the object in the $SubObj variable.

The second command deletes the alert subscription in $SubObj.

PS C:\> $SubObj = Get-CMAlertSubscription -Id "16777310"
PS C:\> Remove-CMAlertSubscription -AlertSubscription $SubObj

New-CMAlertSubscription

Get-CMAlertSubscription

Set-CMAlertSubscription