Remove-SCServicingWindowSubscription

Removes a servicing window from a virtual machine, host, or service.

Syntax

Remove-SCServicingWindowSubscription [-ServicingWindow] <ServicingWindow> [-Confirm] [-JobVariable <String>]
 [-PROTipID <Guid>] [-RunAsynchronously] -Service <Service> [-WhatIf] [<CommonParameters>]
Remove-SCServicingWindowSubscription [-ServicingWindow] <ServicingWindow> [-Confirm] [-JobVariable <String>]
 [-PROTipID <Guid>] [-RunAsynchronously] -VM <VM> [-WhatIf] [<CommonParameters>]
Remove-SCServicingWindowSubscription [-ServicingWindow] <ServicingWindow> [-Confirm] [-JobVariable <String>]
 [-PROTipID <Guid>] [-RunAsynchronously] -VMHost <Host> [-WhatIf] [<CommonParameters>]

Description

The Remove-SCServicingWindowSubscription cmdlet removes a servicing window from a virtual machine, host, or service.

Examples

Example 1: Remove a servicing window subscription from all virtual machines owned by a specified user

PS C:\> $SvcWindow = Get-SCServicingWindow -Name "Backup Staging A"
PS C:\> Get-SCVirtualMachine | where {$_.Owner -eq "Contoso\ReneeLo"} | Remove-SCServicingWindowSubscription -ServicingWindow $SvcWindow

The first command gets the servicing window object named Backup Staging A and stores the object in the $SvcWindow variable.

The second command gets all virtual machine objects, selects only the virtual machines that are owned by Contoso\ReneeLo and then uses the pipeline operator to pass the virtual machines to the Remove-SCServicingWindowSubscription cmdlet, which removes all subscriptions for the servicing window stored in $SvcWindow from each virtual machine that is passed to it.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-JobVariable

Specifies that job progress is tracked and stored in the variable named by this parameter.

Type:String
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PROTipID

Specifies the ID of the Performance and Resource Optimization tip (PRO tip) that triggered this action. This parameter lets you audit PRO tips.

Type:Guid
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-RunAsynchronously

Indicates that the job runs asynchronously so that control returns to the command shell immediately.

Type:SwitchParameter
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Service

Specifies a Virtual Machine Manager (VMM) service object.

Type:Service
Required:True
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-ServicingWindow

Specifies a servicing window object.

Type:ServicingWindow
Required:True
Position:0
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-VM

Specifies a virtual machine object.

Type:VM
Required:True
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-VMHost

Specifies a virtual machine host object. VMM supports Hyper-V hosts, VMware ESX hosts, and Citrix XenServer hosts.

For more information about each type of host, see the Add-SCVMHost cmdlet.

Type:Host
Required:True
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-WhatIf

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

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

Notes

* Requires a VMM servicing window subscription object, which you can get with the **Get-SCServicingWindow** cmdlet.