Set-ClusteredScheduledTask
Set-ClusteredScheduledTask
Changes settings for a clustered scheduled task.
構文
Parameter Set: Object
Set-ClusteredScheduledTask [-TaskName] <String> [-InputObject] <CimInstance> [[-Cluster] <String> ] [-AsJob] [-CimSession <CimSession[]> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]
Parameter Set: Params
Set-ClusteredScheduledTask [-TaskName] <String> [[-Action] <CimInstance[]> ] [[-Trigger] <CimInstance[]> ] [[-Settings] <CimInstance> ] [[-Description] <String> ] [[-Cluster] <String> ] [-AsJob] [-CimSession <CimSession[]> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]
Parameter Set: Xml
Set-ClusteredScheduledTask [-TaskName] <String> [-Xml] <String> [[-Cluster] <String> ] [-AsJob] [-CimSession <CimSession[]> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]
詳細説明
The Set-ClusteredScheduledTask cmdlet changes settings for a clustered scheduled task. For instance, you can change the actions or triggers associated with a task.
You can make changes to a task even if an instance of the task is currently running. Any changes do not affect any actions already initiated.
For more information about the Task Scheduler, see the Task Scheduler Overview topic in the TechNet Library at https://technet.microsoft.com/en-us/library/cc721871.aspx.
パラメーター
-Action<CimInstance[]>
Specifies an array of action objects to use in the task. To obtain a task action object, use the New-ScheduledTaskAction cmdlet.
A task can have a single action or up to 32 actions. If you specify more than one action, the cluster runs them in sequence.
エイリアス |
なし |
必須? |
false |
位置は? |
2 |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-AsJob
エイリアス |
なし |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-CimSession<CimSession[]>
リモート セッションまたはリモート コンピューターでコマンドレットを実行します。New-CimSession コマンドレットや Get-CimSession コマンドレットの出力など、コンピューター名またはセッション オブジェクトを入力します。既定値は、ローカル コンピューターで実行中の現在のセッションです。
エイリアス |
Session |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-Cluster<String>
Specifies the name of a failover cluster. If you do not specify a cluster, the cmdlet uses the current node cluster name.
エイリアス |
なし |
必須? |
false |
位置は? |
6 |
既定値 |
"." |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-Description<String>
Specifies a description of a task.
エイリアス |
なし |
必須? |
false |
位置は? |
5 |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-InputObject<CimInstance>
このコマンドレットへの入力を指定します。このパラメーターを使用するか、パイプを使用して入力をこのコマンドレットに渡すことができます。 This is a clustered scheduled task object. To obtain a clustered scheduled task object, use the Get-ClusteredScheduledTask cmdlet.
エイリアス |
なし |
必須? |
true |
位置は? |
2 |
既定値 |
なし |
パイプライン入力を許可する |
True (ByValue) |
ワイルドカード文字を許可する |
false |
-Settings<CimInstance>
Specifies a CimInstance object that contains properties that Windows Task Scheduler uses to configure running of a task. To obtain a settings object, use the New-ScheduledTaskSettingSet cmdlet.
エイリアス |
なし |
必須? |
false |
位置は? |
4 |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-TaskName<String>
Specifies a name of a scheduled task.
エイリアス |
なし |
必須? |
true |
位置は? |
1 |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-ThrottleLimit<Int32>
このコマンドレットを実行するために確立できる最大同時操作数を指定します。このパラメーターを省略するか、値として 0
を入力した場合、Windows PowerShell® では、コンピューターで実行している CIM コマンドレットの数に基づいて、コマンドレットに対する最適なスロットル制限を計算します。スロットル制限は現在のコマンドレットのみに適用され、セッションまたはコンピューターには適用されません。
エイリアス |
なし |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-Trigger<CimInstance[]>
Specifies an array of trigger objects to use in the task. To obtain a task trigger object, use the New-ScheduledTaskTrigger cmdlet.
A trigger is a set of criteria that starts the running of a task. You can use both time-based and event-based triggers. One or more triggers can start a task. You can specify up to 48 triggers.
エイリアス |
なし |
必須? |
false |
位置は? |
3 |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-Xml<String>
Specifies an XML-formatted string that contains a task definition. You can export a task definition from Task Scheduler.
The string represents the triggers, actions, and other settings for a task. The string uses the Task Scheduler Schema.
エイリアス |
なし |
必須? |
true |
位置は? |
2 |
既定値 |
なし |
パイプライン入力を許可する |
True (ByValue) |
ワイルドカード文字を許可する |
false |
<CommonParameters>
このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。
入力
入力型は、コマンドレットにパイプできるオブジェクトの型です。
出力
出力型は、コマンドレットによって生成されるオブジェクトの型です。
- Microsoft.Management.Infrastructure.CimInstance#MSFT_ClusteredScheduledTask
例
Example 1: Change actions for a task
This example changes the task actions for a scheduled task.
The first command uses the New-ScheduledTaskAction cmdlet to create a task action and stores that action in the $Action01 variable.
The second command uses the New-ScheduledTaskAction cmdlet to create a task action and stores that action in the $Action02 variable.
The final command changes the action assigned to the task named Task03 to the the two actions stored in $Action01 and $Action02. The cluster runs more than one action in sequence.
PS C:\> $Action01 = New-ScheduledTaskAction -Execute Notepad
PS C:\> $Action02 = New-ScheduledTaskAction -Execute Calc
PS C:\> Set-ClusteredScheduledTask -TaskName "Task03" -Action $Action01,$Action02