Edit

Share via


Get-AzAutomationJob

Gets Automation runbook jobs.

Syntax

ByAll (Default)

Get-AzAutomationJob
    [-ResourceGroupName] <String>
    [-AutomationAccountName] <String>
    [-Status <String>]
    [-StartTime <DateTimeOffset>]
    [-EndTime <DateTimeOffset>]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

ByJobId

Get-AzAutomationJob
    [-ResourceGroupName] <String>
    [-AutomationAccountName] <String>
    -Id <Guid>
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

ByRunbookName

Get-AzAutomationJob
    [-ResourceGroupName] <String>
    [-AutomationAccountName] <String>
    -RunbookName <String>
    [-Status <String>]
    [-StartTime <DateTimeOffset>]
    [-EndTime <DateTimeOffset>]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

Description

The Get-AzAutomationJob cmdlet gets runbook jobs in Azure Automation.

Examples

Example 1: Get a specific runbook job

Get-AzAutomationJob -AutomationAccountName "Contoso17" -ResourceGroupName "ResourceGroup01" -Id 2989b069-24fe-40b9-b3bd-cb7e5eac4b647

This command gets the job that has the specified GUID.

Example 2: Get all jobs for a runbook

Get-AzAutomationJob -AutomationAccountName "Contoso17" -ResourceGroupName "ResourceGroup01" -RunbookName "Runbook02"

This command gets all jobs associated with a runbook named Runbook02.

Example 3: Get all running jobs

Get-AzAutomationJob -AutomationAccountName "Contoso17" -ResourceGroupName "ResourceGroup01" -Status "Running"

This command gets all running jobs in the Automation account named Contoso17.

Parameters

-AutomationAccountName

Specifies the name of an Automation account for which this cmdlet gets jobs.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-EndTime

Specifies the end time for a job as a DateTimeOffset object. You can specify a string that can be converted to a valid DateTimeOffset. This cmdlet gets jobs that have an end time at or before the value that this parameter specifies.

Parameter properties

Type:

Nullable<T>[DateTimeOffset]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByAll
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByRunbookName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Id

Specifies the ID of a job that this cmdlet gets.

Parameter properties

Type:Guid
Default value:None
Supports wildcards:False
DontShow:False
Aliases:JobId

Parameter sets

ByJobId
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ResourceGroupName

Specifies the name of a resource group in which this cmdlet gets jobs.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-RunbookName

Specifies the name of a runbook for which this cmdlet gets jobs.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:Name

Parameter sets

ByRunbookName
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-StartTime

Specifies the start time of a job as a DateTimeOffset object. This cmdlet gets jobs that have a start time at or after the value that this parameter specifies.

Parameter properties

Type:

Nullable<T>[DateTimeOffset]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByAll
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByRunbookName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Status

Specifies the status of a job. This cmdlet gets jobs that have a status matching this parameter. Valid values are:

  • Activating
  • Completed
  • Failed
  • Queued
  • Resuming
  • Running
  • Starting
  • Stopped
  • Stopping
  • Suspended
  • Suspending

Parameter properties

Type:String
Default value:None
Accepted values:Completed, Failed, Queued, Starting, Resuming, Running, Stopped, Stopping, Suspended, Suspending, Activating
Supports wildcards:False
DontShow:False

Parameter sets

ByAll
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByRunbookName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

Guid

String

Outputs

Job