Update-AzSqlServerVulnerabilityAssessmentSetting
Updates the vulnerability assessment settings of a server.
Syntax
UpdateSettingsWithStorageAccountNameParameterSet (Default)
Update-AzSqlServerVulnerabilityAssessmentSetting
[-ResourceGroupName] <String>
[-ServerName] <String>
[-StorageAccountName <String>]
[-ScanResultsContainerName <String>]
[-RecurringScansInterval <RecurringScansInterval>]
[-EmailAdmins <Boolean>]
[-NotificationEmail <String[]>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
UpdateSettingsWithBlobStorageSasUri
Update-AzSqlServerVulnerabilityAssessmentSetting
[-ResourceGroupName] <String>
[-ServerName] <String>
-BlobStorageSasUri <Uri>
[-RecurringScansInterval <RecurringScansInterval>]
[-EmailAdmins <Boolean>]
[-NotificationEmail <String[]>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Update-AzSqlServerVulnerabilityAssessmentSetting
-InputObject <VulnerabilityAssessmentSettingsModel>
[-RecurringScansInterval <RecurringScansInterval>]
[-EmailAdmins <Boolean>]
[-NotificationEmail <String[]>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Update-AzSqlServerVulnerabilityAssessmentSetting cmdlet updates the vulnerability assessment settings of an Azure SQL Server.
Note that you need to run Enable-AzSqlServerAdvancedDataSecurity cmdlet as a prerequisite for using this cmdlet.
Examples
Example 1: Update Vulnerability Assessment settings with storage account name
Update-AzSqlServerVulnerabilityAssessmentSetting `
-ResourceGroupName "ResourceGroup01"`
-ServerName "Server01"`
-StorageAccountName "mystorage" `
-ScanResultsContainerName "vulnerability-assessment" `
-RecurringScansInterval Weekly `
-EmailAdmins $true `
-NotificationEmail @("mail1@mail.com" , "mail2@mail.com")
ResourceGroupName : ResourceGroup01
ServerName : Server01
StorageAccountName : mystorage
ScanResultsContainerName : vulnerability-assessment
RecurringScansInterval : Weekly
EmailAdmins : True
NotificationEmail : {mail1@mail.com , mail2@mail.com}
Example 2: Update Vulnerability Assessment settings with blob storage SAS URI
Update-AzSqlServerVulnerabilityAssessmentSetting `
-ResourceGroupName "ResourceGroup01"`
-ServerName "Server01"`
-BlobStorageSasUri "https://mystorage.blob.core.windows.net/vulnerability-assessment?st=XXXXXX" `
-RecurringScansInterval Weekly `
-EmailAdmins $true `
-NotificationEmail @("mail1@mail.com" , "mail2@mail.com")
ResourceGroupName : ResourceGroup01
ServerName : Server01
StorageAccountName : mystorage
ScanResultsContainerName : vulnerability-assessment
RecurringScansInterval : Weekly
EmailAdmins : True
NotificationEmail : {mail1@mail.com , mail2@mail.com}
Example 3: Update the Vulnerability Assessment settings from ServerVulnerabilityAssessmentSettingsModel instance definition
Update-AzSqlServerVulnerabilityAssessmentSetting `
-ResourceGroupName "ResourceGroup01"`
-ServerName "Server01"`
-StorageAccountName "mystorage" `
-ScanResultsContainerName "vulnerability-assessment" `
-RecurringScansInterval Weekly `
-EmailAdmins $true `
-NotificationEmail @("mail1@mail.com" , "mail2@mail.com")
Get-AzSqlServerVulnerabilityAssessmentSetting `
-ResourceGroupName "ResourceGroup01" `
-ServerName "Server01" `
| Update-AzSqlServerVulnerabilityAssessmentSetting `
-ResourceGroupName "ResourceGroup02" `
-ServerName "Server02"
ResourceGroupName : ResourceGroup02
ServerName : Server02
StorageAccountName : mystorage
ScanResultsContainerName : vulnerability-assessment
RecurringScansInterval : Weekly
EmailAdmins : True
NotificationEmail : {mail1@mail.com , mail2@mail.com}
This command updated the Vulnerability Assessment settings on Server02 from the settings on Server01
Parameters
-BlobStorageSasUri
A SAS URI to a storage container that will hold the scan results.
Parameter properties
Type: Uri
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
UpdateSettingsWithBlobStorageSasUri
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Aliases: cf
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with Azure.
Parameter properties
Type: IAzureContextContainer
Default value: None
Supports wildcards: False
DontShow: False
Aliases: AzContext, AzureRmContext, AzureCredential
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-EmailAdmins
A value indicating whether to email service and co-administrators on recurring scan completion.
Parameter properties
Type: Boolean
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: True
Value from remaining arguments: False
The Vulnerability Assessment settings object to set
UpdateByInputObjectParameterSet
Position: Named
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-NotificationEmail
A list of mail addresses to send on recurring scan completion.
Parameter properties
Type: String [ ]
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: True
Value from remaining arguments: False
-RecurringScansInterval
The recurring scans interval.
Parameter properties
Type: RecurringScansInterval
Default value: None
Accepted values: None, Weekly
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-ResourceGroupName
The name of the resource group.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
UpdateSettingsWithStorageAccountNameParameterSet
Position: 0
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
UpdateSettingsWithBlobStorageSasUri
Position: 0
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ScanResultsContainerName
The name of the storage container that will hold the scan results.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
UpdateSettingsWithStorageAccountNameParameterSet
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-ServerName
SQL Database server name.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
UpdateSettingsWithStorageAccountNameParameterSet
Position: 1
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
UpdateSettingsWithBlobStorageSasUri
Position: 1
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-StorageAccountName
The name of the storage account that will hold the scan results.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
UpdateSettingsWithStorageAccountNameParameterSet
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Aliases: wi
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 .
Outputs