Set-SCService
修改 VMM 服務實例。
Syntax
Set-SCService
[-Name <String>]
[-Description <String>]
[-Owner <String>]
[-CostCenter <String>]
[-ServicePriority <ServicePriority>]
[-VMMServer <ServerConnection>]
[-Service] <Service>
[-UserRole <UserRole>]
[-Cloud <Cloud>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[-OnBehalfOfUser <String>]
[-OnBehalfOfUserRole <UserRole>]
[<CommonParameters>]
Set-SCService
[-Name <String>]
[-Description <String>]
[-Owner <String>]
[-CostCenter <String>]
[-ServicePriority <ServicePriority>]
[-VMMServer <ServerConnection>]
[-Service] <Service>
-PendingServiceTemplate <ServiceTemplate>
[-UserRole <UserRole>]
[-Cloud <Cloud>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[-OnBehalfOfUser <String>]
[-OnBehalfOfUserRole <UserRole>]
[<CommonParameters>]
Set-SCService
[-Name <String>]
[-Description <String>]
[-Owner <String>]
[-CostCenter <String>]
[-ServicePriority <ServicePriority>]
[-VMMServer <ServerConnection>]
[-Service] <Service>
[-DismissPendingServiceTemplate]
[-WhatIf]
[-UserRole <UserRole>]
[-Cloud <Cloud>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[-OnBehalfOfUser <String>]
[-OnBehalfOfUserRole <UserRole>]
[<CommonParameters>]
Set-SCService
[-Name <String>]
[-Description <String>]
[-Owner <String>]
[-CostCenter <String>]
[-ServicePriority <ServicePriority>]
[-VMMServer <ServerConnection>]
[-Service] <Service>
[-CommitPendingServiceTemplate]
[-WhatIf]
[-UserRole <UserRole>]
[-Cloud <Cloud>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[-OnBehalfOfUser <String>]
[-OnBehalfOfUserRole <UserRole>]
[<CommonParameters>]
Description
Set-SCService Cmdlet 會修改 Virtual Machine Manager (VMM) 服務實例。
範例
範例 1:變更服務的描述和優先順序
PS C:\> $Service = Get-SCService -Name "Service01"
PS C:\> Set-SCService -Service $Service -Description "Contoso Custom Service" -ServicePriority Normal
第一個命令命令會取得名為 Service01 的服務物件,並將物件儲存在$Service變數中。
第二個命令會更新儲存在 $Service 中的服務描述和優先順序。
範例 2:關閉擱置的服務範本
PS C:\> $Service = Get-SCService -Name "Service01"
PS C:\> Set-SCService -Service $Service -DismissPendingServiceTemplate
第一個命令會取得名為 Service01 的服務物件,並將物件儲存在$Service變數中。
第二個命令會關閉擱置的服務作業。
參數
-Cloud
指定私人雲端物件。
Type: | Cloud |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-CommitPendingServiceTemplate
將擱置的服務範本套用至服務實例。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-CostCenter
指定虛擬機器的成本中心,以便您可以收集虛擬機器配置 (或者配置給虛擬機器的資源) 的相關資料,而收集的資料可運用在計費系統中。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Description
指定服務實例的描述。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DismissPendingServiceTemplate
從服務實例中移除擱置的服務範本。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
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 |
-Name
指定 VMM 物件的名稱。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-OnBehalfOfUser
指定使用者名稱。 這個 Cmdlet 會代表此參數所指定的使用者運作。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-OnBehalfOfUserRole
指定使用者角色。 若要取得使用者角色,請使用 Get-SCUserRole Cmdlet。 這個 Cmdlet 會代表此參數所指定的使用者角色運作。
Type: | UserRole |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Owner
以有效網域使用者帳戶的格式指定 VMM 物件的擁有者。
- 範例格式:
-Owner "Contoso\PattiFuller"
- 範例格式:
-Owner "PattiFuller@Contoso"
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PendingServiceTemplate
指定已更新但未套用至服務實例的服務範本物件。
Type: | ServiceTemplate |
Position: | Named |
Default value: | None |
Required: | True |
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
指定 VMM 服務物件。
Type: | Service |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ServicePriority
指定服務的優先順序。 有效值為:Normal、Low、High。 預設值:一般。
Type: | ServicePriority |
Accepted values: | Normal, Low, High |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-UserRole
指定使用者角色物件。
Type: | UserRole |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-VMMServer
指定 VMM 伺服器物件。
Type: | ServerConnection |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-WhatIf
顯示執行 Cmdlet 後會發生的情況。 Cmdlet 並不會執行。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
輸出
Service
此 Cmdlet 會傳回 Service 物件。