Update-SCSMSubscription

Update-SCSMSubscription

Updates subscription properties in Service Manager.

Sintaxis

Parameter Set: Default
Update-SCSMSubscription [-Subscription] <Subscription[]> [-PassThru] [-Confirm] [-WhatIf] [ <CommonParameters>]

Descripción detallada

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

Parámetros

-PassThru

Specifies the output object that represents the subscription to update. This output object can be passed to other cmdlets.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-Subscription<Subscription[]>

Specifies an object which represents the subscription to update. This is returned by the Get-SCSMSubscription cmdlet.

Alias

ninguno

¿Requerido?

true

¿Posición?

1

Valor predeterminado

ninguno

¿Aceptar canalización?

true (ByValue)

¿Aceptar caracteres comodín?

false

-Confirm

Solicita confirmación antes de ejecutar el cmdlet.

¿Requerido?

false

¿Posición?

named

Valor predeterminado

falso

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-WhatIf

Muestra lo que sucedería si se ejecutara el cmdlet. El cmdlet no se ejecuta.

¿Requerido?

false

¿Posición?

named

Valor predeterminado

falso

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

<CommonParameters>

Este cmdlet admite los siguientes parámetros comunes: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer y -OutVariable. Para obtener más información, consulte about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Entradas

El tipo de entrada es el tipo de los objetos que se pueden canalizar al cmdlet.

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

    You can pipe a subscription to the Subscription parameter.

Salidas

El tipo de resultado es el tipo de objetos que emite el cmdlet.

  • None.

    This cmdlet does not generate any output.

Ejemplos

Example 1: Update the email template for a 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 the Get-SCSMsubscription cmdlet.

PS C:\>Get-SCSMsubscription -DisplayName "Subscription01"

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

Temas relacionados

Get-SCSMSetting

New-SCSMSubscription

Remove-SCSMSubscription