Dela via


Update-SCSMSubscription

Uppdaterar prenumerationsegenskaper i Service Manager.

Syntax

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

Description

Update-SCSMSubscription cmdlet uppdaterar prenumerationsegenskaper i Service Manager.

Exempel

Exempel 1: Uppdatera e-postmallen för en prenumeration

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

Det här exemplet uppdaterar e-postmallen som används med prenumerationen med namnet Subscription01 och lägger till woodgrove-administratören i mottagarlistan. Det första kommandot visar den prenumeration som uppdateras med hjälp av Get-SCSMsubscription.

Parametrar

-Confirm

Uppmanar dig att bekräfta innan du kör cmdleten.

Typ:System.Management.Automation.SwitchParameter
Alias:cf
Position:Named
Standardvärde:False
Obligatorisk:False
Godkänn pipeline-indata:False
Godkänn jokertecken:False

-PassThru

Anger att den här cmdleten returnerar den prenumeration som den uppdaterar. Du kan skicka det här objektet till andra cmdletar.

Typ:SwitchParameterSystem.Management.Automation.SwitchParameter
Position:Named
Standardvärde:None
Obligatorisk:False
Godkänn pipeline-indata:False
Godkänn jokertecken:False

-Subscription

Anger den prenumeration som den här cmdleten uppdaterar. Om du vill skaffa en prenumeration använder du cmdleten Get-SCSMSubscription.

Typ:Microsoft.EnterpriseManagement.ServiceManager.Sdk.Notifications.Subscriptions.Subscription[]
Position:0
Standardvärde:None
Obligatorisk:True
Godkänn pipeline-indata:True
Godkänn jokertecken:False

-WhatIf

Visar vad som skulle hända om cmdleten körs. Cmdleten körs inte.

Typ:System.Management.Automation.SwitchParameter
Alias:wi
Position:Named
Standardvärde:False
Obligatorisk:False
Godkänn pipeline-indata:False
Godkänn jokertecken:False

Indata

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

Du kan skicka en prenumeration till parametern Subscription.

Utdata

None.

Den här cmdleten genererar inga utdata.