CmdID / PowerShell / Cmdlets / Disable
Disable-JobTrigger
Disables the job triggers of scheduled jobs. PowerShell reference
From the PowerShell reference 4 parameters
What it does
Disables the job triggers of scheduled jobs. The Disable-JobTrigger cmdlet temporarily disables the job triggers of scheduled jobs. Disabling preserves all job trigger properties, but it prevents the job trigger from starting the scheduled job. To use this cmdlet, use the Get-JobTrigger cmdlet to get the job triggers. Then pipe the job triggers to Disable-JobTrigger or use its InputObject parameter. To disable a job trigger, the Disable-JobTrigger cmdlet sets the Enabled property of the job trigger to $false. To re-enable the job trigger, use the Enable-JobTrigger cmdlet, which sets the Enabled property of the job trigger to $true. Disabling a job trigger does not disable the scheduled job, such as is done by the Disable-ScheduledJob cmdlet, but if you disable all job triggers, the effect is the same as disabling the scheduled job. If you disable a scheduled job or disable all job triggers of a scheduled job, you can still start the job by using the Start-Job cmdlet or use the disabled scheduled job as a template. Disable-ScheduledJob is one of a collection of job scheduling cmdlets in the PSScheduledJob module that is included in Windows 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 was introduced in Windows PowerShell 3.0.
Disable-JobTrigger [-InputObject] <ScheduledJobTrigger[]> [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
Disable a job trigger
PS C:> Get-JobTrigger -Name "Backup-Archives" -TriggerId 1 | Disable-JobTriggerIdentifyDisable all job triggers
Get-ScheduledJob -Name "Backup-Archives,Inventory" | Get-JobTrigger | Disable-JobTrigger
Get-ScheduledJob -Name "Backup-Archives,Inventory" |
Get-JobTrigger |
Format-Table -Property Id, Frequency, At, DaysOfWeek, Enabled,
@{Label="JobName";Expression={$_.JobDefinition.Name}} -AutoSizeIdentifyDisable job trigger of a scheduled job on a remote computer
Invoke-Command -ComputerName Server01 {
Get-JobTrigger -Name DeployPackage |
Where-Object {$_.Frequency -eq "Daily"} |
Disable-JobTrigger
}IdentifyIts page in the reference: Disable-JobTrigger.
Parameters
-InputObjectSpecifies the job trigger to be disabled. Enter a variable that contains ScheduledJobTrigger
objects or type a command or expression that gets ScheduledJobTrigger objects, such as a
Get-JobTrigger command. You can also pipe a ScheduledJobTrigger object to
Disable-JobTrigger.-PassThruReturns an object representing the item with which you are working. By default, this cmdlet does not generate any output.-ConfirmPrompts you for confirmation before running the cmdlet.-WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.