Set-CMAlertSubscription

Changes the properties of an alert subscription.

Syntax

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

Description

The Set-CMAlertSubscription cmdlet changes the properties of an alert subscription object in Microsoft System Center 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.

Examples

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

PS C:\> Set-CMAlertSubscription -Id "16777217" -NewName "Subscription02" -EmailAddress "evan.narvaez@contoso.com" -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 C:\> Set-CMAlertSubscription -Name "Subscription01" -NewName "Subscription02" -EmailAddress "elisa.daugherty@contoso.com" -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 C:\> $SubObj = Get-CMAlertSubscription -Id "16777310"
PS C:\> Set-CMAlertSubscription -AlertSubscription $SubObj -NewName "Subscription02" -EmailAddress "patti.fuller@contoso.com" -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 C:\> 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 C:\> Set-CMAlertSubscription -SecurityScopeAction RemoveMembership -SecurityScopeName "Test" -Name "Subscription01"

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

Required Parameters

-Id

Specifies the identifier for a subscription object.

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

Specifies an alert notification object in Configuration Manager.

Type:IResultObject
Required:True
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Name

Specifies the name of an alert subscription object.

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

Optional Parameters

-AlertId

Specifies an array of alert IDs for subscriptions.

Type:Int32[]
Aliases:AlertIds
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-DisableWildcardHandling

Indicates that wildcard handling is disabled.

Type:SwitchParameter
Required:False
Position:Named
Default value:None
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
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ForceWildcardHandling

Indicates that wildcard handling is enabled.

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

Specifies a locale for alert messages. For more information and a list of locale identifiers, see the Locale IDs Assigned by Microsoft topic at http://go.microsoft.com/fwlink/?LinkId=262651.

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

Specifies a new name for an alert subscription object.

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

Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.

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

Shows what would happen if the cmdlet runs. The cmdlet is not run.

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