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.
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.
Get a job trigger by scheduled job name:
PS C:\> Get-JobTrigger -Name BackupJob
Display the scheduled jobs, with their IDs on the local computer:
PS C:\> 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
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.