Remove-SCServicingWindowSubscription
從虛擬機器、主機或服務中移除服務視窗。
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
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 提示) 效能和資源優化提示的識別碼。 此參數可讓您稽核 PRO 秘訣。
Type: | Guid |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RunAsynchronously
表示作業會以非同步方式執行,讓控制項立即返回命令殼層。
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 取得此物件。