New-AzureRmAutomationSoftwareUpdateConfiguration
Creates a scheduled azure automation software update configuration.
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
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 |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-AzureVMResourceId
Resource Ids for azure virtual machines.
Type: | String[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
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 |
-Duration
Maximum duration for the update.
Type: | TimeSpan |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ExcludedKbNumber
KB numbers of excluded updates.
Type: | String[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ExcludedPackageNameMask
Excluded Linux package masks.
Type: | String[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-IncludedKbNumber
KB numbers of included updates.
Type: | String[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-IncludedPackageClassification
Included Linux package classifications.
Type: | LinuxPackageClasses[] |
Accepted values: | Unclassified, Critical, Security, Other |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-IncludedPackageNameMask
Included Linux package masks.
Type: | String[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-IncludedUpdateClassification
Included Windows Update classifications.
Type: | WindowsUpdateClasses[] |
Accepted values: | Unclassified, Critical, Security, UpdateRollup, FeaturePack, ServicePack, Definition, Tools, Updates |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Linux
Indicates that the software update configuration targeting Linux operating system machines.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-NonAzureComputer
Non-Azure computer names.
Type: | String[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ResourceGroupName
The resource group name.
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Schedule
Schedule object used for software update configuration.
Type: | Schedule |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
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 |
Required: | False |
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 |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Inputs
String[]