Edit

Share via


Start-AzAutomationRunbook

Starts a runbook job.

Syntax

ByAsynchronousReturnJob (Default)

Start-AzAutomationRunbook
    [-Name] <String>
    [-ResourceGroupName] <String>
    [-AutomationAccountName] <String>
    [-Parameters <IDictionary>]
    [-RunOn <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

BySynchronousReturnJobOutput

Start-AzAutomationRunbook
    [-Name] <String>
    [-ResourceGroupName] <String>
    [-AutomationAccountName] <String>
    [-Parameters <IDictionary>]
    [-RunOn <String>]
    [-Wait]
    [-MaxWaitSeconds <Int32>]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

Description

The Start-AzAutomationRunbook cmdlet starts an Azure Automation runbook job. Specify the ID or name of a runbook.

Examples

Example 1: Start a runbook job

Start-AzAutomationRunbook -AutomationAccountName "Contoso17" -Name "Runbk01" -ResourceGroupName "ResourceGroup01"

This command starts a runbook job for the runbook named Runbk01 in the Azure Automation account named Contoso17.

Example 2: Start a Python 2 runbook job with parameters

$params = [ordered]@{"Key1"="ValueForPosition1";"Key2"="ValueForPosition2"}
Start-AzAutomationRunbook -AutomationAccountName "Contoso17" -Name "RunbkPy01" -ResourceGroupName "ResourceGroup01" -Parameters $params

This command starts a runbook job for the Python 2 runbook named RunbkPy01 in the Azure Automation account named Contoso17 with "ValueForPosition1" as the first positional parameter and "ValueForPosition2" for the second one.

Example 3: Start a runbook job and wait for results

Start-AzAutomationRunbook -AutomationAccountName "Contoso17" -Name "Runbk01" -ResourceGroupName "ResourceGroup01" -MaxWaitSeconds 1000 -Wait

This command starts a runbook job for the runbook named Runbk01 in the Azure Automation account named Contoso17. This command specifies the Wait parameter. Therefore, it returns results after the job is completed. The cmdlet waits up to 1000 seconds for the results.

Parameters

-AutomationAccountName

The Start-AzAutomationRunbook cmdlet starts an Azure Automation runbook job. Specify the ID or name of a runbook.

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

-MaxWaitSeconds

Specifies the number of seconds this cmdlet waits for a job to finish before it abandons the job. The default value is 10800, or three hours.

Parameter properties

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

Parameter sets

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

-Name

The Start-AzAutomationRunbook cmdlet starts an Azure Automation runbook job. Specify the ID or name of a runbook.

Parameter properties

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

Parameter sets

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

-Parameters

The Start-AzAutomationRunbook cmdlet starts an Azure Automation runbook job. Specify the ID or name of a runbook.

Parameter properties

Type:IDictionary
Default value:None
Supports wildcards:False
DontShow:False
Aliases:JobParameters

Parameter sets

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

-ResourceGroupName

The Start-AzAutomationRunbook cmdlet starts an Azure Automation runbook job. Specify the ID or name of a runbook.

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

-RunOn

Specifies which Hybrid Worker Group on which to run the runbook.

Parameter properties

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

Parameter sets

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

-Wait

Indicates that this cmdlet waits for job to complete, suspend, or fail, and then returns control to Azure PowerShell.

Parameter properties

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

Parameter sets

BySynchronousReturnJobOutput
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

String

Outputs

Job

PSObject