Get-JobTrigger (PowerShell 3.0+)

Get the job triggers of scheduled jobs.

Syntax
      Get-JobTrigger [-InputObject] ScheduledJobDefinition [[-TriggerId] Int32[]] [CommonParameters]

      Get-JobTrigger [-Id] Int32 [[-TriggerId] Int32[]] [CommonParameters]

      Get-JobTrigger [-Name] String [[-TriggerId] Int32[]] [CommonParameters]

key
   -Id Int32[]
       Tthe identification numbers of the scheduled jobs.
       Add-JobTrigger adds the job trigger to the specified scheduled jobs.
       To get the identification number of scheduled jobs on the local computer or a remote computer,
       use the Get-ScheduledJob.

   -InputObject ScheduledJobDefinition[]
       The scheduled jobs. Enter a variable that contains ScheduledJob objects or type
       a command or expression that gets ScheduledJob objects, such as Get-ScheduledJob.
       You can also pipe ScheduledJob objects to Add-JobTrigger.

   -Name String[]
       The names of the scheduled jobs.   Wildcards are supported.
       Add-JobTrigger adds the job triggers to the specified scheduled jobs.
       To get the names of scheduled jobs, use Get-ScheduledJob.

   -TriggerId Int32[]
       Get the specified job triggers.
       Enter the trigger IDs of one or more job triggers of a scheduled job.
       Use this parameter when the scheduled job that is specified by the Name, ID, or InputObject
       parameters has multiple job triggers.

   CommonParameters:
       -Verbose, -Debug, -ErrorAction, -ErrorVariable, -WarningAction, -WarningVariable,
       -OutBuffer -PipelineVariable, -OutVariable.

Use this command to examine the job triggers or to pipe the job triggers to other cmdlets. A "job trigger" defines a recurring schedule or conditions for starting a scheduled job. Job triggers are not saved to disk independently; they are part of a scheduled job. To get a job trigger, specify the scheduled job that the trigger starts.

Examples

Get a job trigger by scheduled job name:

C:\PS> Get-JobTrigger -Name BackupJob

Display the scheduled jobs, with their IDs on the local computer:

C:\PS> Get-ScheduledJob

Get the job trigger with ID = 2:

PS C:\> Get-JobTrigger -ID 2

Get the JobTriggers property of the demojob scheduled job:

PS C:\> (Get-ScheduledJob demojob).JobTriggers

“There might be 1 finger on the trigger, but there will be 15 fingers on the safety catch” ~ Harold Macmillan

Related PowerShell Cmdlets:

Scheduler cmdlets - Get/Set scheduled jobs.
Add-JobTrigger - Add a job trigger to a scheduled job.
New-JobTrigger - Create a new Job Trigger.
Set-JobTrigger - Change the job trigger of a scheduled job.


 
Copyright © SS64.com 1999-2019
Some rights reserved