Modifier

Partager via


New-AzVMSqlServerAutoPatchingConfig

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

Syntax

New-AzVMSqlServerAutoPatchingConfig
   [-Enable]
   [-DayOfWeek <String>]
   [-MaintenanceWindowStartingHour <Int32>]
   [-MaintenanceWindowDuration <Int32>]
   [-PatchCategory <String>]
   [<CommonParameters>]

Description

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

Examples

Example 1: Create a configuration object to configure automatic patching

$AutoPatchingConfig = New-AzVMSqlServerAutoPatchingConfig -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-AzVMSqlServerExtension 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