Contact Info

Crumbtrail » Administration » Powershell » Powershell 3.0 » Set-ScheduledJob

Set-ScheduledJob - Powershell 3.0 CmdLet

ActiveXperts Network Monitor ships with integrated Powershell scripts to monitor complex network. The scripts run out of the box
Download the ActiveXperts Network Monitor FREE version now »


Short description
Changes scheduled jobs

Set-ScheduledJob [-InputObject] <ScheduledJobDefinition> [-ArgumentList <Object[]>] [-Authentication <AuthenticationMec
hanism>] [-Credential <PSCredential>] [-InitializationScript <ScriptBlock>] [-MaxResultCount <Int32>] [-Name <String>] 
[-PassThru] [-RunAs32] [-ScheduledJobOption <ScheduledJobOptions>] [-ScriptBlock <ScriptBlock>] [-Trigger <ScheduledJob
Trigger[]>] [<CommonParameters>]
Set-ScheduledJob [-InputObject] <ScheduledJobDefinition> [-ArgumentList <Object[]>] [-Authentication <AuthenticationMec
hanism>] [-Credential <PSCredential>] [-FilePath <String>] [-InitializationScript <ScriptBlock>] [-MaxResultCount <Int3
2>] [-Name <String>] [-PassThru] [-RunAs32] [-ScheduledJobOption <ScheduledJobOptions>] [-Trigger <ScheduledJobTrigger[
]>] [<CommonParameters>]
Set-ScheduledJob [-InputObject] <ScheduledJobDefinition> [-ClearExecutionHistory] [-PassThru] [<CommonParameters>]

The Set-ScheduledJob cmdlet changes the properties of scheduled jobs, such as the commands that the jobs run or the cre
dentials required to run the job. You can also use it to clear the execution history of the scheduled job.

To use this cmdlet, begin by using the Get-ScheduledJob cmdlet to get the scheduled job. Then, pipe the scheduled job t
o Set-ScheduledJob or save the job in a variable and use the InputObject parameter of Set-ScheduledJob to identify the 
job. Use the remaining parameters of Set-ScheduledJob to change the job properties or clear the execution history.

Although you can use Set-ScheduledJob to change the triggers and options of a scheduled job, the Add-JobTrigger, Set-Jo
bTrigger, and Set-ScheduledJobOption cmdlets provide much easier ways to accomplish those tasks. To create a new schedu
led job, use the Register-ScheduledJob cmdlet.

Set-ScheduledJob is one of a collection of job scheduling cmdlets in the PSScheduledJob module that is included in Wind
ows PowerShell.

For more information about Scheduled Jobs, see the About topics in the PSScheduledJob module. Import the PSScheduledJob
 module and then type: Get-Help about_Scheduled* or see about_Scheduled_Jobs.

This cmdlet is introduced in Windows PowerShell 3.0.