你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Update-AzSqlInstanceDatabaseVulnerabilityAssessmentSetting

更新托管数据库的漏洞评估设置。

语法

Update-AzSqlInstanceDatabaseVulnerabilityAssessmentSetting
      [-InstanceName] <String>
      [-DatabaseName] <String>
      [-StorageAccountName <String>]
      [-ScanResultsContainerName <String>]
      [-RecurringScansInterval <RecurringScansInterval>]
      [-EmailAdmins <Boolean>]
      [-NotificationEmail <String[]>]
      [-ResourceGroupName] <String>
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Update-AzSqlInstanceDatabaseVulnerabilityAssessmentSetting
      [-InstanceName] <String>
      [-DatabaseName] <String>
      -InputObject <VulnerabilityAssessmentSettingsModel>
      [-RecurringScansInterval <RecurringScansInterval>]
      [-EmailAdmins <Boolean>]
      [-NotificationEmail <String[]>]
      [-ResourceGroupName] <String>
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Update-AzSqlInstanceDatabaseVulnerabilityAssessmentSetting
      [-InstanceName] <String>
      [-DatabaseName] <String>
      -BlobStorageSasUri <Uri>
      [-RecurringScansInterval <RecurringScansInterval>]
      [-EmailAdmins <Boolean>]
      [-NotificationEmail <String[]>]
      [-ResourceGroupName] <String>
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

说明

Update-AzSqlInstanceDatabaseVulnerabilityAssessmentSetting cmdlet 更新 Azure SQL 托管数据库的漏洞评估设置。 请注意,需要运行 Enable-AzSqlInstanceAdvancedDataSecurity cmdlet 作为使用此 cmdlet 的先决条件。

示例

示例 1:使用存储帐户名称更新漏洞评估设置

Update-AzSqlInstanceDatabaseVulnerabilityAssessmentSetting `
            -ResourceGroupName "ResourceGroup01" `
            -InstanceName "ManagedInstance01" `
            -DatabaseName "Database01" `
            -StorageAccountName "mystorage" `
            -ScanResultsContainerName "vulnerability-assessment" `
            -RecurringScansInterval Weekly `
            -EmailAdmins $true `
            -NotificationEmail @("mail1@mail.com" , "mail2@mail.com")

ResourceGroupName				: ResourceGroup01
InstanceName			    	: ManagedInstance01
DatabaseName			    	: Database01
StorageAccountName     			: mystorage
ScanResultsContainerName		: vulnerability-assessment
RecurringScansInterval			: Weekly
EmailAdmins						: True
NotificationEmail				: {mail1@mail.com , mail2@mail.com}

示例 2:使用 Blob 存储 SAS URI 更新漏洞评估设置

Update-AzSqlInstanceDatabaseVulnerabilityAssessmentSetting `
            -ResourceGroupName "ResourceGroup01" `
            -InstanceName "ManagedInstance01" `
            -DatabaseName "Database01" `
            -BlobStorageSasUri "https://mystorage.blob.core.windows.net/vulnerability-assessment?st=XXXXXX" `
            -RecurringScansInterval Weekly `
            -EmailAdmins $true `
            -NotificationEmail @("mail1@mail.com" , "mail2@mail.com")

ResourceGroupName				: ResourceGroup01
InstanceName			   		: ManagedInstance01
DatabaseName			   		: Database01
StorageAccountName     			: mystorage
ScanResultsContainerName		: vulnerability-assessment
RecurringScansInterval			: Weekly
EmailAdmins						: True
NotificationEmail				: {mail1@mail.com , mail2@mail.com}

示例 3:从 ManagedDatabaseVulnerabilityAssessment 更新漏洞评估设置设置Model 实例定义

Update-AzSqlInstanceDatabaseVulnerabilityAssessmentSetting `
            -ResourceGroupName "ResourceGroup01" `
            -InstanceName "ManagedInstance01" `
            -DatabaseName "Database01" `
            -StorageAccountName "mystorage" `
            -ScanResultsContainerName "vulnerability-assessment" `
            -RecurringScansInterval Weekly `
            -EmailAdmins $true `
            -NotificationEmail @("mail1@mail.com" , "mail2@mail.com")

Get-AzSqlInstanceDatabaseVulnerabilityAssessmentSetting `
            -ResourceGroupName "ResourceGroup01" `
            -InstanceName "ManagedInstance01" `
            -DatabaseName "Database01" 
            | Update-AzSqlInstanceDatabaseVulnerabilityAssessmentSetting `
                -ResourceGroupName "ResourceGroup02" `
                -InstanceName "ManagedInstance02" `
                -DatabaseName "Database02"

ResourceGroupName				: ResourceGroup02
InstanceName			   		: ManagedInstance02
DatabaseName			   		: Database02
StorageAccountName     			: mystorage
ScanResultsContainerName		: vulnerability-assessment
RecurringScansInterval			: Weekly
EmailAdmins						: True
NotificationEmail				: {mail1@mail.com , mail2@mail.com}

此命令从 Database01 上的设置更新了 Database02 上的漏洞评估设置

示例 4:更新托管实例下所有数据库的漏洞评估设置

Get-AzSqlInstanceDatabase -ResourceGroupName "ResourceGroup01" `
			-InstanceName $"ManagedInstance01" `
            | Where-Object {$_.Name -ne "master"}  `
            | Update-AzSqlInstanceDatabaseVulnerabilityAssessmentSetting `
                -StorageAccountName "mystorage" `
                -ScanResultsContainerName "vulnerability-assessment" `
                -RecurringScansInterval Weekly `
                -EmailAdmins $true `
				-NotificationEmail @("mail1@mail.com" , "mail2@mail.com")

ResourceGroupName				: ResourceGroup01
InstanceName			   		: ManagedInstance01
DatabaseName			   		: Database01
StorageAccountName     			: mystorage
ScanResultsContainerName		: vulnerability-assessment
RecurringScansInterval			: Weekly
EmailAdmins						: True
NotificationEmail				: {mail1@mail.com , mail2@mail.com}

ResourceGroupName				: ResourceGroup01
InstanceName			   		: ManagedInstance01
DatabaseName			   		: Database02
StorageAccountName     			: mystorage
ScanResultsContainerName		: vulnerability-assessment
RecurringScansInterval			: Weekly
EmailAdmins						: True
NotificationEmail				: {mail1@mail.com , mail2@mail.com}

此命令更新 ManagedInstance01 下所有数据库的所有漏洞评估设置

参数

-BlobStorageSasUri

存储容器的 SAS URI,用于保存扫描结果。

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

-Confirm

提示你在运行 cmdlet 之前进行确认。

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

-DatabaseName

SQL 托管数据库名称。

Type:String
Position:2
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-DefaultProfile

用于与 Azure 通信的凭据、帐户、租户和订阅。

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-EmailAdmins

一个值,该值指示是否在定期扫描完成时向服务和共同管理员发送电子邮件。

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

-InputObject

要设置的漏洞评估设置对象

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

-InstanceName

SQL 托管实例名称。

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-NotificationEmail

定期扫描完成时要发送的邮件地址列表。

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-RecurringScansInterval

定期扫描间隔。

Type:RecurringScansInterval
Accepted values:None, Weekly
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ResourceGroupName

资源组的名称。

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ScanResultsContainerName

将保存扫描结果的存储容器的名称。

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

-StorageAccountName

将保存扫描结果的存储帐户的名称。

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

-WhatIf

显示运行该 cmdlet 时会发生什么情况。 cmdlet 未运行。

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

输入

String

VulnerabilityAssessmentSettingsModel

Uri

RecurringScansInterval

Boolean

String[]

输出

ManagedDatabaseVulnerabilityAssessmentSettingsModel