Start-​Azure​Rm​Automation​Runbook

Starts a runbook job.

Syntax

Start-AzureRmAutomationRunbook
     [-ResourceGroupName] <String>
     [-AutomationAccountName] <String>
     [-Name] <String>
     [-Parameters <IDictionary>]
     [-RunOn <String>]
     [-Wait]
     [-MaxWaitSeconds <Int32>]
     [<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.

Required Parameters

-AutomationAccountName
Type:String
Position:2
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Name
Type:String
Aliases:RunbookName
Position:3
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ResourceGroupName
Type:String
Position:1
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-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
Accept pipeline input:False
Accept wildcard characters:False
-Parameters
Type:IDictionary
Position:Named
Default value:None
Accept pipeline input:False
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
Accept pipeline input:True (ByPropertyName)
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
Accept pipeline input:False
Accept wildcard characters:False

Outputs

Microsoft.Azure.Commands.Automation.Model.Job