Register-ClusteredScheduledTask
Registers a scheduled task on a failover cluster.
構文
Parameter Set: Object
Register-ClusteredScheduledTask [-TaskName] <String> [[-TaskType] <ClusterTaskTypeEnum> ] [-InputObject] <CimInstance> [[-Cluster] <String> ] [[-Resource] <String> ] [-AsJob] [-CimSession <CimSession[]> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]
Parameter Set: Params
Register-ClusteredScheduledTask [-TaskName] <String> [[-TaskType] <ClusterTaskTypeEnum> ] [-Action] <CimInstance[]> [[-Trigger] <CimInstance[]> ] [[-Settings] <CimInstance> ] [[-Description] <String> ] [[-Cluster] <String> ] [[-Resource] <String> ] [-AsJob] [-CimSession <CimSession[]> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]
Parameter Set: Xml
Register-ClusteredScheduledTask [-TaskName] <String> [[-TaskType] <ClusterTaskTypeEnum> ] [-Xml] <String> [[-Cluster] <String> ] [[-Resource] <String> ] [-AsJob] [-CimSession <CimSession[]> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]
詳細説明
The Register-ClusteredScheduledTask cmdlet registers a clustered scheduled task on a failover cluster. The new task runs scheduled actions as defined by task triggers. As specified in the TaskType parameter, an action runs on a resource specific node, an active failover node, or on all cluster nodes.
For more information about the Windows Server® 2012 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.
エイリアス |
なし |
必須? |
true |
位置は? |
3 |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-AsJob
エイリアス |
なし |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-CimSession<CimSession[]>
リモート セッションまたはリモート コンピューターでコマンドレットを実行します。New-CimSession コマンドレットや Get-CimSession コマンドレットの出力など、コンピューター名またはセッション オブジェクトを入力します。既定値は、ローカル コンピューターで実行中の現在のセッションです。
エイリアス |
Session |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-Cluster<String>
Specifies a name of a failover cluster. If you do not specify a cluster, the cmdlet uses the current node cluster name.
エイリアス |
なし |
必須? |
false |
位置は? |
7 |
既定値 |
"." |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-Description<String>
Specifies a description of a task.
エイリアス |
なし |
必須? |
false |
位置は? |
6 |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-InputObject<CimInstance>
このコマンドレットへの入力を指定します。このパラメーターを使用するか、パイプを使用して入力をこのコマンドレットに渡すことができます。 This is a clustered scheduled task object. To obtain a clustered scheduled task object, use the Get-ClusteredScheduledTask cmdlet.
エイリアス |
なし |
必須? |
true |
位置は? |
3 |
既定値 |
なし |
パイプライン入力を許可する |
True (ByValue) |
ワイルドカード文字を許可する |
false |
-Resource<String>
Specifies a cluster resource identifier. This identifier defines a set of failover cluster nodes. If you define a value of ResourceSpecific for the TaskType parameter, the task runs on the defined cluster nodes.
エイリアス |
なし |
必須? |
false |
位置は? |
5 |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
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 |
位置は? |
5 |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-TaskName<String>
Specifies a name of a scheduled task.
エイリアス |
なし |
必須? |
true |
位置は? |
1 |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-TaskType<ClusterTaskTypeEnum>
Specifies a type for the task. このパラメーターに対して使用できる値:
-- ResourceSpecific. Resource specific cluster nodes.
-- AnyNode. Active cluster nodes.
-- ClusterWide. All cluster nodes.
エイリアス |
なし |
必須? |
false |
位置は? |
2 |
既定値 |
なし |
パイプライン入力を許可する |
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 |
位置は? |
4 |
既定値 |
なし |
パイプライン入力を許可する |
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 |
位置は? |
3 |
既定値 |
なし |
パイプライン入力を許可する |
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: Register a task on a cluster
This example registers a cluster-wide task.
The first command uses the New-ScheduledTaskAction cmdlet to create a task action and stores that action in the $Action variable.
The second command uses the New-ScheduledTaskTrigger cmdlet to create a task trigger and stores that trigger in the $Trigger variable.
The final command registers a scheduled task named CalcTask01 for all cluster nodes in the cluster Cluster01. The task uses the action and trigger stored in the two variables.
PS C:\> $Action = New-ScheduledTaskAction -Execute Calc
PS C:\> $Trigger = New-ScheduledTaskTrigger -At 12:00 -Once
PS C:\> Register-ClusteredScheduledTask -TaskName "CalcTask01" -TaskType ClusterWide -Action $Action -Trigger $Trigger -Cluster "Cluster01"
Example 2: Register a task on the current cluster
This example registers an active cluster nodes scheduled task.
The first command uses the New-ScheduledTaskAction cmdlet to create a task action and stores that action in the $Action variable.
The second command uses the New-ScheduledTaskTrigger cmdlet to create a task trigger and stores that trigger in the $Trigger variable.
The final command registers a scheduled task named CalcTask02 for active cluster nodes. Because the command does not specify a cluster, it uses the current cluster. The task uses the action and trigger stored in the two variables.
PS C:\> $Action = New-ScheduledTaskAction -Execute Calc
PS C:\> $Trigger = New-ScheduledTaskTrigger -At 12:00 -Once
PS C:\> Register-ClusteredScheduledTask -TaskName "CalcTask02" -TaskType AnyNode -Action $Action -Trigger $Trigger