Get-AzureAutomationJob

Gets one or more Azure Automation runbook jobs.

Note

The cmdlets referenced in this documentation are for managing legacy Azure resources that use Service Management APIs. See the Az PowerShell module for cmdlets to manage Azure Resource Manager resources.

Syntax

Get-AzureAutomationJob
   [-Status <String>]
   [-StartTime <DateTimeOffset>]
   [-EndTime <DateTimeOffset>]
   -AutomationAccountName <String>
   [-Profile <AzureSMProfile>]
   [<CommonParameters>]
Get-AzureAutomationJob
   -Id <Guid>
   -AutomationAccountName <String>
   [-Profile <AzureSMProfile>]
   [<CommonParameters>]
Get-AzureAutomationJob
   -RunbookName <String>
   [-Status <String>]
   [-StartTime <DateTimeOffset>]
   [-EndTime <DateTimeOffset>]
   -AutomationAccountName <String>
   [-Profile <AzureSMProfile>]
   [<CommonParameters>]

Description

Important

This PowerShell command for Azure Automation is longer supported as of 01/23/2020. The Azure Service Management model is deprecated for Azure Automation and was disabled on that date. Please use the commands which support the Azure Resource Management model in Az.Automation.

The Get-AzureAutomationJob cmdlet gets one or more runbook jobs in Microsoft Azure Automation.

Examples

Example 1: Get a specific runbook job

PS C:\> Get-AzureAutomationJob -AutomationAccountName "Contoso17" -Id 2989b069-24fe-40b9-b3bd-cb7e5eac4b647

This command gets the job that has the specified GUID.

Example 2: Get all jobs for a runbook

PS C:\> Get-AzureAutomationJob -AutomationAccountName "Contoso17" -RunbookName "MyRunbook"

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

Example 2: Get all running jobs

PS C:\> Get-AzureAutomationJob -AutomationAccountName "Contoso17" -Status "Running"

This command gets all running jobs in the automation account with the name Contoso17.

Parameters

-AutomationAccountName

Specifies the name of an Azure Automation account.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-EndTime

Specifies the end time for a job.

Type:DateTimeOffset
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Id

Specifies the ID of a job.

Type:Guid
Aliases:JobId
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Profile

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.

Type:AzureSMProfile
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RunbookName

Specifies the name of a runbook.

Type:String
Aliases:Name
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-StartTime

Specifies the start time of a job.

Type:DateTimeOffset
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Status

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

  • Completed
  • Failed
  • Queued
  • Starting
  • Resuming
  • Running
  • Stopped
  • Stopping
  • Suspended
  • Suspending
  • Activating
Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Outputs

Job