Set-CMAlertSubscription

Changes the properties of an alert subscription.

Syntax

Set-CMAlertSubscription
   [-AddEmailAddress <String[]>]
   [-AlertId <Int32[]>]
   [-EmailAddress <String[]>]
   -InputObject <IResultObject>
   [-LocaleId <Int32>]
   [-NewName <String>]
   [-PassThru]
   [-RemoveEmailAddress <String[]>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-CMAlertSubscription
   [-AddEmailAddress <String[]>]
   [-AlertId <Int32[]>]
   [-EmailAddress <String[]>]
   -Id <String>
   [-LocaleId <Int32>]
   [-NewName <String>]
   [-PassThru]
   [-RemoveEmailAddress <String[]>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-CMAlertSubscription
   [-AddEmailAddress <String[]>]
   [-AlertId <Int32[]>]
   [-EmailAddress <String[]>]
   [-LocaleId <Int32>]
   -Name <String>
   [-NewName <String>]
   [-PassThru]
   [-RemoveEmailAddress <String[]>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The Set-CMAlertSubscription cmdlet changes the properties of an alert subscription object in Configuration Manager. You can change the name of an alert subscription, the email address of the recipient of an alert notification, the Windows locale ID, and the alert ID. You can also change the security scope membership of an alert subscription by adding it to or removing it from a specified security scope.

Note

Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>. For more information, see getting started.

Examples

Example 1: Change the properties of an alert subscription by subscription ID

PS XYZ:\> Set-CMAlertSubscription -Id "16777217" -NewName "Subscription02" -EmailAddress "[email protected]" -LocaleId 2057 -AlertIds 16777240

This command changes the name, email address, Windows locale ID, and alert ID of an alert subscription that has the ID 16777217.

Example 2: Change the properties of an alert subscription by subscription name

PS XYZ:\> Set-CMAlertSubscription -Name "Subscription01" -NewName "Subscription02" -EmailAddress "[email protected]" -LocaleId 2057 -AlertIds 16777240

This command changes the name, email address, Windows locale ID, and alert ID of an alert subscription named Subscription01.

Example 3: Change the properties of an alert subscription by using the output from another cmdlet as input

PS XYZ:\> $SubObj = Get-CMAlertSubscription -Id "16777310"
PS XYZ:\> Set-CMAlertSubscription -AlertSubscription $SubObj -NewName "Subscription02" -EmailAddress "[email protected]" -LocaleId 3081 -AlertIds 16777240

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 changes the properties of the alert subscription object, which include the subscription name, email recipient, locale ID, and alert ID, for the alert notification stored in the $SubObj variable.

Example 4: Add an alert subscription to a security scope

PS XYZ:\> Set-CMAlertSubscription -SecurityScopeAction AddMembership -SecurityScopeName "Test" -Name "Subscription01"

This command adds the alert subscription named Subscription01 to the security scope named Test.

Example 5: Remove an alert subscription from a security scope

PS XYZ:\> Set-CMAlertSubscription -SecurityScopeAction RemoveMembership -SecurityScopeName "Test" -Name "Subscription01"

This command removes the alert subscription named Subscription01 from the security scope named Test.

Parameters

-AddEmailAddress

Type:String[]
Aliases:AddEmailAddresses
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-AlertId

Specifies an array of alert IDs for subscriptions.

Type:Int32[]
Aliases:AlertIds
Position:Named
Default value:None
Required:False
Accept pipeline input:False
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

-DisableWildcardHandling

This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-EmailAddress

Specifies an email address where you want to send an alert notification. You can separate multiple email addresses by using a semicolon.

Type:String[]
Aliases:EmailAddresses
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ForceWildcardHandling

This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Id

Specifies the identifier for a subscription object.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

Specifies an alert notification object in Configuration Manager.

Type:IResultObject
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-LocaleId

Specifies a locale for alert messages. For more information and a list of locale identifiers, see Appendix A: Product Behavior.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

Specifies the name of an alert subscription object.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-NewName

Specifies a new name for an alert subscription object.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PassThru

Add this parameter to return an object that represents the item with which you're working. By default, this cmdlet may not generate any output.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RemoveEmailAddress

Type:String[]
Aliases:RemoveEmailAddresses
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet doesn't run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject

Outputs

System.Object