Update-SCSMSubscription

Updates subscription properties in Service Manager.

Syntax

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.

Type:System.Management.Automation.SwitchParameter
Aliases:cf
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PassThru

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

Type:SwitchParameterSystem.Management.Automation.SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Subscription

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

Type:Microsoft.EnterpriseManagement.ServiceManager.Sdk.Notifications.Subscriptions.Subscription[]
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

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

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

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.