Update-SCSMSubscription
Update-SCSMSubscription
Updates subscription properties in Service Manager.
Syntax
Parameter Set: Default
Update-SCSMSubscription [-Subscription] <Subscription[]> [-PassThru] [-Confirm] [-WhatIf] [ <CommonParameters>]
Detailed Description
The Update-SCSMSubscription cmdlet updates subscription properties in Service Manager.
Parameters
-PassThru
Specifies the output object that represents the subscription to update. This output object can be passed to other cmdlets.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Subscription<Subscription[]>
Specifies an object which represents the subscription to update. This is returned by the Get-SCSMSubscription cmdlet.
Aliases |
none |
Required? |
true |
Position? |
1 |
Default Value |
none |
Accept Pipeline Input? |
true (ByValue) |
Accept Wildcard Characters? |
false |
-Confirm
Prompts you for confirmation before running the cmdlet.
Required? |
false |
Position? |
named |
Default Value |
false |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? |
false |
Position? |
named |
Default Value |
false |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Microsoft.EnterpriseManagement.ServiceManager.Sdk.Notifications.Subscriptions.Subscription
You can pipe a subscription to the Subscription parameter of the Update-SCSMSubscription cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
None.
This cmdlet does not generate any output.
Examples
-------------------------- EXAMPLE 1 --------------------------
These commands update the Email template which is used with the "Subscription1" subscription, and add the 'woodgrove' administrator to the recipient list. The first command displays the subscription that is being updated.
PS C:\>Get-SCSMsubscription -displayname Subscription1
PS C:\>$mySubscription = Get-SCSMsubscription -displayname Subscription1
PS C:\>$mySubscription.Template = Get-SCSMEmailTemplate "Template2"
PS C:\>$class=Get-SCClass -Name System.Domain.User
PS C:\>$user=Get-SCClassInstance -Class $class -Filter "UserName -eq user"
PS C:\>$mySubscription.RecipientUsers +=$user.EnterpriseManagementObject
PS C:\>Update-SCSMSubscription $mySubscription