Remove-SCServicingWindowSubscription
从虚拟机、主机或服务中删除服务窗口。
语法
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>]
说明
Remove-SCServicingWindowSubscription cmdlet 从虚拟机、主机或服务中删除服务窗口。
示例
示例 1:从指定用户拥有的所有虚拟机中删除服务窗口订阅
PS C:\> $SvcWindow = Get-SCServicingWindow -Name "Backup Staging A"
PS C:\> Get-SCVirtualMachine | where {$_.Owner -eq "Contoso\ReneeLo"} | Remove-SCServicingWindowSubscription -ServicingWindow $SvcWindow
第一个命令获取名为 Backup Staging A 的服务窗口对象,并将该对象存储在$SvcWindow变量中。
第二个命令获取所有虚拟机对象,仅选择 Contoso\ReneeLo 拥有的虚拟机,然后使用管道运算符将虚拟机传递给 Remove-SCServicingWindowSubscription cmdlet,这将从传递给它的每个虚拟机中删除存储在$SvcWindow的服务窗口的所有订阅。
参数
-Confirm
提示你在运行 cmdlet 之前进行确认。
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-JobVariable
指定跟踪作业进度,并将其存储在此参数命名的变量中。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PROTipID
指定触发此操作 (PRO 提示) 的性能和资源优化提示的 ID。 此参数允许审核 PRO 提示。
Type: | Guid |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RunAsynchronously
指示作业以异步方式运行,以便控件立即返回到命令 shell。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Service
指定 Virtual Machine Manager (VMM) 服务对象。
Type: | Service |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ServicingWindow
指定服务窗口对象。
Type: | ServicingWindow |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-VM
指定一个虚拟机对象。
Type: | VM |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-VMHost
指定一个虚拟主机对象。 VMM 支持 Hyper-V 主机、VMware ESX 主机和 Citrix XenServer 主机。
有关每种类型的主机的详细信息,请参阅 Add-SCVMHost cmdlet。
Type: | Host |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-WhatIf
显示在此 cmdlet 运行的情况下将会发生什么。 此 cmdlet 未运行。
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
备注
- 需要 VMM 服务窗口订阅对象,可以使用 Get-SCServicingWindow cmdlet 获取该对象。