Set-SCServiceSetting
修改服務設定。
Syntax
Set-SCServiceSetting
[-Value <String>]
[-VMMServer <ServerConnection>]
[-ServiceSetting] <ServiceSetting>
[-Description <String>]
[-IsRequired <Boolean>]
[-IsEncrypted <Boolean>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[-OnBehalfOfUser <String>]
[-OnBehalfOfUserRole <UserRole>]
[<CommonParameters>]
Set-SCServiceSetting
[-SecureValue <SecureString>]
[-VMMServer <ServerConnection>]
[-ServiceSetting] <ServiceSetting>
[-Description <String>]
[-IsRequired <Boolean>]
[-IsEncrypted <Boolean>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[-OnBehalfOfUser <String>]
[-OnBehalfOfUserRole <UserRole>]
[<CommonParameters>]
Description
Set-SCServiceSetting Cmdlet 會修改服務設定。
範例
範例 1:進行強制服務設定
PS C:\> $Template = Get-SCServiceTemplate -Name "ServiceTemplate01" | where {$_.Release -eq "Beta"}
PS C:\> $ServiceSetting = Get-SCServiceSetting -ServiceTemplate $Template -Name "Setting01"
PS C:\> Set-SCServiceSetting -ServiceSetting $ServiceSetting -IsRequired $True
第一個命令會取得名為 ServiceTemplate01 且具有 Beta 版本的服務範本物件,並將物件儲存在$ServiceTemplate變數中。
第二個命令會從 ServiceTemplate01 取得名為 Setting01 的服務設定物件,並將物件儲存在$ServiceSetting變數中。
最後一個命令會修改服務設定,使其是必要的。
參數
-Description
指定服務設定的描述。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IsEncrypted
指出服務設定是否已加密。
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IsRequired
指出服務設定是否為必要。
Type: | Boolean |
Position: | Named |
Default value: | None |
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 |
-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 |
-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 |
-SecureValue
指定安全字串的值。
Type: | SecureString |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ServiceSetting
指定服務設定物件。
Type: | ServiceSetting |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Value
指定用來屬性物件或屬性的字串。
Type: | String |
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 |