New-AzureRmAutomationSoftwareUpdateConfiguration

Creates a scheduled azure automation software update configuration.

Syntax

New-AzureRmAutomationSoftwareUpdateConfiguration
   -Schedule <Schedule>
   [-Windows]
   [-AzureVMResourceId <String[]>]
   [-NonAzureComputer <String[]>]
   [-Duration <TimeSpan>]
   [-IncludedUpdateClassification <WindowsUpdateClasses[]>]
   [-ExcludedKbNumber <String[]>]
   [-IncludedKbNumber <String[]>]
   [-ResourceGroupName] <String>
   [-AutomationAccountName] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzureRmAutomationSoftwareUpdateConfiguration
   -Schedule <Schedule>
   [-Linux]
   [-AzureVMResourceId <String[]>]
   [-NonAzureComputer <String[]>]
   [-Duration <TimeSpan>]
   [-IncludedPackageClassification <LinuxPackageClasses[]>]
   [-ExcludedPackageNameMask <String[]>]
   [-IncludedPackageNameMask <String[]>]
   [-ResourceGroupName] <String>
   [-AutomationAccountName] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Creates a software update configuration that runs on a schedule to update a list of computers. Computers include both azure virtual machines or non-azure computers.

Examples

Example 1

Creates a software update configuration to install critical updates on two Windows azure virtual machines once every Saturday 9PM. Update duration is set to 2 hours in this example.

PS C:\> $startTime = [DateTimeOffset]"2018-09-13T21:00"
PS C:\> $targetMachines = @( `
    "/subscriptions/22e2445a-0984-4fa5-86a4-0280d76c4b2c/resourceGroups/compute/providers/Microsoft.Compute/virtualMachines/vm-w-01", `
    "/subscriptions/22e2445a-0984-4fa5-86a4-0280d76c4b2c/resourceGroups/compute/providers/Microsoft.Compute/virtualMachines/vm-w-02"
    )
PS C:\> $duration = New-TimeSpan -Hours 2
PS C:\> $schedule = New-AzureRmAutomationSchedule -ResourceGroupName "mygroup" `
                                                  -AutomationAccountName "myaccount" `
                                                  -Name MyWeeklySchedule `
                                                  -StartTime $startTime `
                                                  -DaysOfWeek Saturday `
                                                  -WeekInterval 1 `
                                                  -ForUpdateConfiguration

New-AzureRmAutomationSoftwareUpdateConfiguration -ResourceGroupName "mygroup" `
                                                 -AutomationAccountName "myaccount" `
                                                 -Schedule $schedule `
                                                 -Windows `
                                                 -AzureVMResourceIds $targetMachines `
                                                 -IncludedUpdateClassifications Critical `
                                                 -Duration $duration

UpdateConfiguration   : Microsoft.Azure.Commands.Automation.Model.UpdateManagement.UpdateConfiguration
ScheduleConfiguration : Microsoft.Azure.Commands.Automation.Model.Schedule
ProvisioningState     : Provisioning
ErrorInfo             :
ResourceGroupName     : mygroup
AutomationAccountName : myaccount
Name                  : MyWeeklySchedule
CreationTime          : 9/14/2018 3:53:27 AM +00:00
LastModifiedTime      : 9/14/2018 3:53:27 AM +00:00
Description           :

Parameters

-AutomationAccountName

The automation account name.

Type:String
Position:1
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-AzureVMResourceId

Resource Ids for azure virtual machines.

Type:System.String[]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:Microsoft.Azure.Commands.Common.Authentication.Abstractions.IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Duration

Maximum duration for the update.

Type:TimeSpan
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ExcludedKbNumber

KB numbers of excluded updates.

Type:System.String[]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ExcludedPackageNameMask

Excluded Linux package masks.

Type:System.String[]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-IncludedKbNumber

KB numbers of included updates.

Type:System.String[]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-IncludedPackageClassification

Included Linux package classifications.

Type:Microsoft.Azure.Commands.Automation.Model.UpdateManagement.LinuxPackageClasses[]
Accepted values:Unclassified, Critical, Security, Other
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-IncludedPackageNameMask

Included Linux package masks.

Type:System.String[]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-IncludedUpdateClassification

Included Windows Update classifications.

Type:Microsoft.Azure.Commands.Automation.Model.UpdateManagement.WindowsUpdateClasses[]
Accepted values:Unclassified, Critical, Security, UpdateRollup, FeaturePack, ServicePack, Definition, Tools, Updates
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Linux

Indicates that the software update configuration targeting Linux operating system machines.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-NonAzureComputer

Non-Azure computer names.

Type:System.String[]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ResourceGroupName

The resource group name.

Type:String
Position:0
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Schedule

Schedule object used for software update configuration.

Type:Schedule
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Windows

Indicates that the software update configuration targeting windows operating system machines.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Inputs

Schedule

SwitchParameter

System.String[]

TimeSpan

Microsoft.Azure.Commands.Automation.Model.UpdateManagement.WindowsUpdateClasses[]

Microsoft.Azure.Commands.Automation.Model.UpdateManagement.LinuxPackageClasses[]

String

Outputs

Microsoft.Azure.Commands.Automation.Model.UpdateManagement.SoftwareUpdateConfiguration