< Back
Set-ClusteredScheduledTask
Post
NAME Set-ClusteredScheduledTask
SYNOPSIS
Changes settings for a clustered scheduled task.
SYNTAX
Set-ClusteredScheduledTask [-TaskName] <String> [[-Action] <CimInstance[]>] [[-Trigger] <CimInstance[]>] [[-Settings] <CimInstance>] [[-Description]
<String>] [[-Cluster] <String>] [-CimSession <CimSession[]>] [-ThrottleLimit <Int32>] [<CommonParameters>]
Set-ClusteredScheduledTask [-TaskName] <String> [-Xml] <String> [[-Cluster] <String>] [-CimSession <CimSession[]>] [-ThrottleLimit <Int32>]
[<CommonParameters>]
Set-ClusteredScheduledTask [-TaskName] <String> [[-Cluster] <String>] [-CimSession <CimSession[]>] [-ThrottleLimit <Int32>] [<CommonParameters>]
DESCRIPTION
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
http://technet.microsoft.com/en-us/libr ... 21871.aspx.
PARAMETERS
-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.
Required? false
Position? 2
Default value none
Accept pipeline input? false
Accept wildcard characters? false
-CimSession [<CimSession[]>]
Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such as the output of a New-CimSession or
Get-CimSession cmdlet. The default is the current session on the local computer.
Required? false
Position? named
Default value none
Accept pipeline input? false
Accept wildcard characters? 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.
Required? false
Position? 6
Default value none
Accept pipeline input? false
Accept wildcard characters? false
-Description [<String>]
Specifies a description of a task.
Required? false
Position? 5
Default value none
Accept pipeline input? false
Accept wildcard characters? 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-ScheduledTaskSettingsSet cmdlet.
Required? false
Position? 4
Default value none
Accept pipeline input? false
Accept wildcard characters? false
-TaskName <String>
Specifies a name of a scheduled task.
Required? true
Position? 1
Default value none
Accept pipeline input? false
Accept wildcard characters? false
-ThrottleLimit [<Int32>]
Specifies the maximum number of concurrent operations that can be established to run the cmdlet. If this parameter is omitted or a value of 0 is
entered, then Windows PowerShell???? calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the
computer. The throttle limit applies only to the current cmdlet, not to the session or to the computer.
Required? false
Position? named
Default value none
Accept pipeline input? false
Accept wildcard characters? 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.
Required? false
Position? 3
Default value none
Accept pipeline input? false
Accept wildcard characters? 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.
Required? true
Position? 2
Default value none
Accept pipeline input? True (ByValue)
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
Microsoft.Management.Infrastructure.CimInstance#MSFT_ClusteredScheduledTask
Example 1: Change actions for a task
PS C:\\> $Action01 = New-ScheduledTaskAction -Execute "Notepad"
PS C:\\> $Action02 = New-ScheduledTaskAction -Execute "Calc"
PS C:\\> Set-ClusteredScheduledTask -TaskName "Task03" -Action $Action01,$Action02
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.
RELATED LINKS
Online Version:
Get-ClusteredScheduledTask
New-ScheduledTaskAction
New-ScheduledTaskSettingsSet
New-ScheduledTaskTrigger
Register-ClusteredScheduledTask
Unregister-ClusteredScheduledTask
SYNOPSIS
Changes settings for a clustered scheduled task.
SYNTAX
Set-ClusteredScheduledTask [-TaskName] <String> [[-Action] <CimInstance[]>] [[-Trigger] <CimInstance[]>] [[-Settings] <CimInstance>] [[-Description]
<String>] [[-Cluster] <String>] [-CimSession <CimSession[]>] [-ThrottleLimit <Int32>] [<CommonParameters>]
Set-ClusteredScheduledTask [-TaskName] <String> [-Xml] <String> [[-Cluster] <String>] [-CimSession <CimSession[]>] [-ThrottleLimit <Int32>]
[<CommonParameters>]
Set-ClusteredScheduledTask [-TaskName] <String> [[-Cluster] <String>] [-CimSession <CimSession[]>] [-ThrottleLimit <Int32>] [<CommonParameters>]
DESCRIPTION
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
http://technet.microsoft.com/en-us/libr ... 21871.aspx.
PARAMETERS
-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.
Required? false
Position? 2
Default value none
Accept pipeline input? false
Accept wildcard characters? false
-CimSession [<CimSession[]>]
Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such as the output of a New-CimSession or
Get-CimSession cmdlet. The default is the current session on the local computer.
Required? false
Position? named
Default value none
Accept pipeline input? false
Accept wildcard characters? 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.
Required? false
Position? 6
Default value none
Accept pipeline input? false
Accept wildcard characters? false
-Description [<String>]
Specifies a description of a task.
Required? false
Position? 5
Default value none
Accept pipeline input? false
Accept wildcard characters? 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-ScheduledTaskSettingsSet cmdlet.
Required? false
Position? 4
Default value none
Accept pipeline input? false
Accept wildcard characters? false
-TaskName <String>
Specifies a name of a scheduled task.
Required? true
Position? 1
Default value none
Accept pipeline input? false
Accept wildcard characters? false
-ThrottleLimit [<Int32>]
Specifies the maximum number of concurrent operations that can be established to run the cmdlet. If this parameter is omitted or a value of 0 is
entered, then Windows PowerShell???? calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the
computer. The throttle limit applies only to the current cmdlet, not to the session or to the computer.
Required? false
Position? named
Default value none
Accept pipeline input? false
Accept wildcard characters? 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.
Required? false
Position? 3
Default value none
Accept pipeline input? false
Accept wildcard characters? 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.
Required? true
Position? 2
Default value none
Accept pipeline input? True (ByValue)
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
Microsoft.Management.Infrastructure.CimInstance#MSFT_ClusteredScheduledTask
Example 1: Change actions for a task
PS C:\\> $Action01 = New-ScheduledTaskAction -Execute "Notepad"
PS C:\\> $Action02 = New-ScheduledTaskAction -Execute "Calc"
PS C:\\> Set-ClusteredScheduledTask -TaskName "Task03" -Action $Action01,$Action02
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.
RELATED LINKS
Online Version:
Get-ClusteredScheduledTask
New-ScheduledTaskAction
New-ScheduledTaskSettingsSet
New-ScheduledTaskTrigger
Register-ClusteredScheduledTask
Unregister-ClusteredScheduledTask