Edit

Share via


New-AzVMSqlServerAutoPatchingConfig

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

Syntax

Default (Default)

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

Parameter properties

Type:String
Default value:None
Accepted values:Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Everyday
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-MaintenanceWindowStartingHour

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

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PatchCategory

Specifies whether important updates should be included.

Parameter properties

Type:String
Default value:None
Accepted values:Important
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

None

Outputs

AutoPatchingSettings