CmdID / PowerShell / Cmdlets / Get
Get-ScheduledJobOption
Gets the job options of scheduled jobs. PowerShell reference
From the PowerShell reference 3 parameters
What it does
Gets the job options of scheduled jobs. The Get-ScheduledJobOption cmdlet gets the job options of scheduled jobs. You can use this command to examine the job options or to pipe the job options to other cmdlets. Job options are not saved to disk independently; they are part of a scheduled job. To get the job options of a scheduled job, specify the scheduled job. Use the parameters of the Get-ScheduledJobOption cmdlet to identify the scheduled job. You can identify scheduled jobs by their names or identification numbers, or by entering or piping ScheduledJob objects, such as those that are returned by the Get-ScheduledJob cmdlet, to Get-ScheduledJobOption. Get-ScheduledJobOption 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.
Get-ScheduledJobOption [-InputObject] <ScheduledJobDefinition> [<CommonParameters>]Get-ScheduledJobOption [-Id] <Int32> [<CommonParameters>]Get-ScheduledJobOption [-Name] <String> [<CommonParameters>]
Get job options
Get-ScheduledJobOption -Name "Backup"IdentifyGet all job options
Get-ScheduledJob | Get-ScheduledJobOptionIdentifyGet selected job options
Get-ScheduledJob |
Get-ScheduledJobOption |
Where-Object {$_.RunElevated -and !$_.WakeToRun}
Get-ScheduledJob |
Get-ScheduledJobOption |
Where-Object {$_.RunElevated -and !$_.WakeToRun} |
ForEach-Object {$_.JobDefinition}IdentifyUse job options to create a new job
$registerScheduledJobSplat = @{
Name = "Archive-Scripts"
FilePath = "\\Srv01\Scripts\ArchiveScripts.ps1"
ScheduledJobOption = Get-ScheduledJobOption -Name "BackupTestLogs"
}
Register-ScheduledJob @registerScheduledJobSplatIdentifyGet job options from a remote computer
$O = Invoke-Command -ComputerName "Srv01" -ScriptBlock {Get-ScheduledJob -Name "DataDemon" }IdentifyIts page in the reference: Get-ScheduledJobOption.
Parameters
-IdSpecifies the identification number of a scheduled job. Get-ScheduledJobOption gets the job options of the specified scheduled job.
To get the identification numbers of scheduled jobs on the local computer or a remote computer, use the Get-ScheduledJob cmdlet.-InputObjectSpecifies a scheduled job. Enter a variable that contains a ScheduledJob object or type a command or expression that gets a ScheduledJob object, such as a Get-ScheduledJob command. You can also pipe a ScheduledJob object to Get-ScheduledJobOption.-NameSpecifies the names of scheduled jobs. Get-ScheduledJobOption gets the job options of the specified scheduled job. Wildcards are supported.
To get the names of scheduled jobs on the local computer or a remote computer, use the
Get-ScheduledJob cmdlet.