Remove-SCServicingWindowSubscription
Removes a servicing window from a virtual machine, host, or service.
Syntax
Remove-SCServicingWindowSubscription
[-ServicingWindow] <ServicingWindow>
-VM <VM>
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-SCServicingWindowSubscription
[-ServicingWindow] <ServicingWindow>
-VMHost <Host>
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-SCServicingWindowSubscription
[-ServicingWindow] <ServicingWindow>
-Service <Service>
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[-WhatIf]
[-Confirm]
[<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 |
Position: | Named |
Default value: | False |
Required: | 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 |
Position: | Named |
Default value: | None |
Required: | False |
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 |
Position: | Named |
Default value: | None |
Required: | False |
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 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Service
Specifies a Virtual Machine Manager (VMM) service object.
Type: | Service |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ServicingWindow
Specifies a servicing window object.
Type: | ServicingWindow |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-VM
Specifies a virtual machine object.
Type: | VM |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
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 |
Position: | Named |
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: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Required: | 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.