Set-SCService
修改 VMM 服务实例。
语法
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>]
说明
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 提示) 的性能和资源优化提示的 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
指定 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 对象。