Get-AzureRmAutomationSoftwareUpdateMachineRun

Gets a list of azure automation software update configuration machine runs.

Important

Because Az PowerShell modules now have all the capabilities of AzureRM PowerShell modules and more, we'll retire AzureRM PowerShell modules on 29 February 2024.

To avoid service interruptions, update your scripts that use AzureRM PowerShell modules to use Az PowerShell modules by 29 February 2024. To automatically update your scripts, follow the quickstart guide.

Syntax

Get-AzureRmAutomationSoftwareUpdateMachineRun
   [-Status <SoftwareUpdateMachineRunStatus>]
   [-TargetComputer <String>]
   [-ResourceGroupName] <String>
   [-AutomationAccountName] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzureRmAutomationSoftwareUpdateMachineRun
   -Id <Guid>
   [-ResourceGroupName] <String>
   [-AutomationAccountName] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzureRmAutomationSoftwareUpdateMachineRun
   [-SoftwareUpdateRunId <Guid>]
   [-Status <SoftwareUpdateMachineRunStatus>]
   [-TargetComputer <String>]
   [-ResourceGroupName] <String>
   [-AutomationAccountName] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzureRmAutomationSoftwareUpdateMachineRun
   [-SoftwareUpdateRun <SoftwareUpdateRun>]
   [-Status <SoftwareUpdateMachineRunStatus>]
   [-TargetComputer <String>]
   [-ResourceGroupName] <String>
   [-AutomationAccountName] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

This cmdlet returns a list of machine runs. Each software update run will trigger a machine run for each of the software update configuration target machine. To get a specific machine run, pass the Id parameter. You can list all the machine runs, all runs for a specific computer, all runs with specific status by passing the corresponding parameters.

Examples

Example 1

This example returns all failed machine runs for the specified azure virtual machine.

PS C:\> $targetComputer = "/subscriptions/22e2445a-0984-4fa5-86a4-0280d76c4b2c/resourceGroups/compute/providers/Microsoft.Compute/virtualMachines/myvm"
PS C:\> Get-AzureRmAutomationSoftwareUpdateMachineRun -ResourceGroupName "mygroup" `
                                                      -AutomationAccountName "myaccount" `
                                                      -TargetComputer $targetComputer `
                                                      -Status Failed

MachineRunId          : 0033d6d6-828d-4712-adab-293cc4fc8809
TargetComputer        : /subscriptions/22e2445a-0984-4fa5-86a4-0280d76c4b2c/resourceGroups/compute/providers/Microsoft.Compute/virtualMachines/myvm
TargetComputerType    : AzureVirtualMachines
SoftwareUpdateRunId   : 46568d26-0182-49b2-8bfd-af3455780397
OperatingSystem       : Windows
Status                : Failed
ResourceGroupName     : mygroup
AutomationAccountName : myaccount
Name                  : 0033d6d6-828d-4712-adab-293cc4fc8809
CreationTime          : 5/17/2018 2:06:44 AM +00:00
LastModifiedTime      : 5/17/2018 2:08:49 AM +00:00

Parameters

-AutomationAccountName

The automation account name.

Type:String
Position:1
Default value:None
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
Accept pipeline input:False
Accept wildcard characters:False
-Id

Id of the software update machine run.

Type:Guid
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-ResourceGroupName

The resource group name.

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

The software update run.

Type:SoftwareUpdateRun
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-SoftwareUpdateRunId

Id of the software update run.

Type:Guid
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-Status

Status of the machine run.

Type:Nullable<T>[SoftwareUpdateMachineRunStatus]
Accepted values:NotStarted, InProgress, Succeeded, Failed, MaintenanceWindowExceeded, FailedToStart
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-TargetComputer

target computer for the machine run. Can be either a non-azure computer name or an azure VM resource id.

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

Inputs

Guid

SoftwareUpdateRun

Nullable<T>[[Microsoft.Azure.Commands.Automation.Model.UpdateManagement.SoftwareUpdateMachineRunStatus, Microsoft.Azure.Commands.ResourceManager.Automation, Version=5.1.1.0, Culture=neutral, PublicKeyToken=null]]

String

Outputs

SoftwareUpdateMachineRun