New-​Azure​VM​Sql​Server​Auto​Patching​Config

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

Syntax

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

Description

The New-AzureVMSqlServerAutoPatchingConfig 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-AzureVMSqlServerAutoPatchingConfig -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.

Optional 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
Parameter Sets:Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Everyday
Position:Named
Default value:None
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
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
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
Accept pipeline input:False
Accept wildcard characters:False
-PatchCategory

Specifies whether important updates should be included.

Type:String
Parameter Sets:Important
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Outputs

AutoPatchingSettings

This cmdlet returns object contains settings for automated patching.