Share via


Update-SCSMSubscription

Updates subscription properties in Service Manager.

Syntax

Default (Default)

Update-SCSMSubscription
    [-Subscription] <Subscription[]>
    [-PassThru]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Update-SCSMSubscription cmdlet updates subscription properties in Service Manager.

Examples

Example 1: Update the email template for a subscription

PS C:\>Get-SCSMsubscription -DisplayName "Subscription01"
displayname    description                           ManagementPack Enabled TimeAdded            LastModified
-----------    -----------                           -------------- ------- ---------            ------------
Subscription01 Just a description for a subscription subscriptionMP true    7/21/2010 9:10:29 PM 7/21/2010 9:10:29 PM

The second command gets the subscription that has the specified display name, and then stores it in the $Subscription variable. The third command gets the user class by using the Get-SCSMClass cmdlet, and then stores it in the $Class variable. The forth command gets an instance of the class in $Class by using the Get-SCSMClassInstance cmdlet. The command stores the instance in the $User variable. The fifth command adds a value to the **RecipientUsers** property of $Subscription. The final command updates the subscription to match the current value of $Subscription.
PS C:\>$Subscription = Get-SCSMsubscription -DisplayName "Subscription01"
PS C:\> $Subscription.Template = Get-SCSMEmailTemplate "Template2"
PS C:\> $Class = Get-SCCMClass -Name "System.Domain.User"
PS C:\> $User = Get-SCClassInstance -Class $Class -Filter "UserName -eq user"
PS C:\> $Subscription.RecipientUsers += $User.EnterpriseManagementObject
PS C:\> Update-SCSMSubscription -Subscription $Subscription

This example updates the email template which is used with the subscription named Subscription01, and adds the woodgrove administrator to the recipient list. The first command displays the subscription that is being updated by using Get-SCSMsubscription.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:System.Management.Automation.SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PassThru

Indicates that this cmdlet returns the subscription that it updates. You can pass this object to other cmdlets.

Parameter properties

Type:SwitchParameterSystem.Management.Automation.SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Subscription

Specifies the subscription that this cmdlet updates. To obtain a subscription, use the Get-SCSMSubscription cmdlet.

Parameter properties

Type:

Microsoft.EnterpriseManagement.ServiceManager.Sdk.Notifications.Subscriptions.Subscription[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

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

Parameter properties

Type:System.Management.Automation.SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

Microsoft.EnterpriseManagement.ServiceManager.Sdk.Notifications.Subscriptions.Subscription

You can pipe a subscription to the Subscription parameter.

Outputs

None.

This cmdlet does not generate any output.