CmdID

CmdID / PowerShell / Cmdlets / Remove

Remove-JobTrigger

Delete job triggers from scheduled jobs. PowerShell reference

From the PowerShell reference 4 parameters

Opens CmdID with your command, read as PowerShell. It is read in your browser and sent nowhere.

What it does

from the PowerShell reference, CC BY 4.0

Delete job triggers from scheduled jobs. The Remove-JobTrigger cmdlet deletes job triggers from scheduled jobs. A job trigger defines a recurring schedule or conditions for starting a scheduled job. To manage job triggers, use the New-JobTrigger, Add-JobTrigger, Set-JobTrigger, and Set-ScheduledJob cmdlets. Use the Name, Id, or InputObject parameters of Remove-JobTrigger to identify the scheduled jobs from which the triggers are removed. Use the TriggerId parameter to identify the job triggers to delete. By default, Remove-JobTrigger deletes all job triggers of a scheduled job. Remove-JobTrigger 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.

Remove-JobTrigger [-TriggerId <Int32[]>] [-InputObject] <ScheduledJobDefinition[]> [<CommonParameters>]
Remove-JobTrigger [-TriggerId <Int32[]>] [-Id] <Int32[]> [<CommonParameters>]
Remove-JobTrigger [-TriggerId <Int32[]>] [-Name] <String[]> [<CommonParameters>]

Delete all job triggers

Remove-JobTrigger -Name "Test*"Identify

Delete selected job triggers

Remove-JobTrigger -Name "BackupArchive" -TriggerId 3Identify

Delete AtStartup job triggers from all scheduled jobs

function Delete-AtStartup { Get-ScheduledJob | Get-JobTrigger | Where-Object {$_.Frequency -eq "AtStartup"} | ForEach-Object { Remove-JobTrigger -InputObject $_.JobDefinition -TriggerId $_.Id} }Identify

Delete a job trigger from a remote scheduled job

Invoke-Command -ComputerName "Server01" { Remove-JobTrigger -Id 38 -TriggerId 1 }Identify

Its page in the reference: Remove-JobTrigger.

Parameters

4 in the PowerShell reference
-IdSpecifies the identification numbers of the scheduled jobs. Remove-JobTrigger deletes job triggers from the specified scheduled jobs. To get the identification number of scheduled jobs on the local computer or a remote computer, use the Get-ScheduledJob cmdlet.
-InputObjectSpecifies the scheduled jobs. Enter a variable that contains ScheduledJob objects or type a command or expression that gets ScheduledJob objects, such as a Get-ScheduledJob command. You can also pipe ScheduledJob objects to Remove-JobTrigger.
-NameSpecifies the names of the scheduled jobs. Remove-JobTrigger deletes the job triggers from the specified scheduled jobs. Wildcards are supported. To get the names of scheduled jobs on the local computer or a remote computer, use the Get-ScheduledJob cmdlet.
-TriggerIdDeletes only the specified job triggers. By default, Remove-JobTrigger deletes all triggers from the scheduled jobs. Use this parameter when the scheduled jobs have multiple job triggers. Enter the trigger IDs of one or more job triggers of a scheduled job. If you specify multiple scheduled jobs, Remove-JobTrigger deletes the job trigger with the specified ID from all scheduled jobs.