Start-AzureRMAutomationRunbook

Starts a runbook job.

Warning

The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.

Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.

Syntax

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

Description

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

Examples

Example 1: Start a runbook job

PS C:\>Start-AzureRmAutomationRunbook -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 runbook job and wait for results

Start-AzureRmAutomationRunbook -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

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

-DefaultProfile

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

Type:IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters: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.

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

-Name

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

-Parameters

Type:IDictionary
Aliases:JobParameters
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

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

-RunOn

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

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

-Wait

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

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

Inputs

String

Outputs

Job

-This cmdlet returns a Job object, unless you specify the Wait parameter. -If you do not specify Wait, Azure PowerShell returns a Job object immediately. -If you specify Wait, Azure PowerShell completes the job, and then returns the result. -The result is not a Job object.

PSObject