New-AzureRmVMSqlServerAutoPatchingConfig

Creates a configuration object for automatic patching on a virtual machine.

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-AzureRmVMSqlServerAutoPatchingConfig
   [-Enable]
   [-DayOfWeek <String>]
   [-MaintenanceWindowStartingHour <Int32>]
   [-MaintenanceWindowDuration <Int32>]
   [-PatchCategory <String>]
   [<CommonParameters>]

Description

The New-AzureRmVMSqlServerAutoPatchingConfig cmdlet creates a configuration object for automatic patching on a virtual machine.

Examples

Example 1: Create a configuration object to configure automatic patching

PS C:\> $AutoPatchingConfig = New-AzureRmVMSqlServerAutoPatchingConfig -Enable -DayOfWeek "Thursday" -MaintenanceWindowStartingHour 11 -MaintenanceWindowDuration 120 -PatchCategory "Important"
Enable                        : True
DayOfWeek                     : Thursday
MaintenanceWindowStartingHour : 11
MaintenanceWindowDuration     : 120
PatchCategory                 : Important

This command creates configuration object for patching. The command specifies the day of the week and defines the maintenance window. This configuration enables patching that uses these values. The command stores the result in the $AutoBackupConfig variable. You can specify this configuration item for other cmdlets, such as the Set-AzureRmVMSqlServerExtension cmdlet.

Parameters

-DayOfWeek

Specifies the day of the week when updates should be installed. The acceptable values for this parameter are:

  • Sunday
  • Monday
  • Tuesday
  • Wednesday
  • Thursday
  • Friday
  • Saturday
  • Everyday
Type:String
Accepted values:Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Everyday
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Enable

Indicates that automated patching for the virtual machine is enabled. If you enable automated patching the cmdlet puts Windows Update into interactive mode. If you disable automated patching, Windows Update settings do not change.

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

-MaintenanceWindowDuration

Specifies the duration, in minutes, of the maintenance window. Automated patching avoids performing an action that can affect a virtual machine availability outside that window. Specify a multiple of 30 minutes.

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

-MaintenanceWindowStartingHour

Specifies the hour of the day when maintenance window starts. This time defines when updates start to install.

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

-PatchCategory

Specifies whether important updates should be included.

Type:String
Accepted values:Important
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

AutoPatchingSettings