你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Convert-AzSqlInstanceDatabaseVulnerabilityAssessmentScan
将漏洞评估扫描结果转换为 Excel 格式。
语法
Convert-AzSqlInstanceDatabaseVulnerabilityAssessmentScan
[-InstanceName] <String>
[-DatabaseName] <String>
[-ScanId <String>]
[-ResourceGroupName] <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Convert-AzSqlInstanceDatabaseVulnerabilityAssessmentScan
[-InputObject <VulnerabilityAssessmentScanRecordModel>]
[-ScanId <String>]
[-ResourceGroupName] <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
Convert-AzSqlInstanceDatabaseVulnerabilityAssessmentScan cmdlet 将驻留在客户存储中的扫描结果(由 ScanId 参数标识)转换为由 Update-AzSqlInstanceDatabaseVulnerabilityAssessmentSettings cmdlet 定义的存储中的 Excel 格式。 请注意,需要运行 Enable-AzSqlInstanceAdvancedDataSecurity 和 Update-AzSqlInstanceVulnerabilityAssessmentSetting cmdlet 作为使用此 cmdlet 的先决条件。
示例
示例 1 - 转换漏洞评估扫描结果并将其保存到本地磁盘
Update-AzSqlInstanceVulnerabilityAssessmentSetting `
-ResourceGroupName "ResourceGroup01" `
-InstanceName "ManagedInstance01" `
-StorageAccountName "mystorage"
Start-AzSqlInstanceDatabaseVulnerabilityAssessmentScan `
-ResourceGroupName "ResourceGroup01" `
-InstanceName "ManagedInstance01" `
-DatabaseName "Database01" `
-ScanId "myScan"
$convert_scan_results = Convert-AzSqlInstanceDatabaseVulnerabilityAssessmentScan `
-ResourceGroupName "ResourceGroup01" `
-InstanceName "ManagedInstance01" `
-DatabaseName "Database01" `
-ScanId "myScan"
ResourceGroupName : "ResourceGroup01"
InstanceName : "ManagedInstance01"
DatabaseName : "Database01"
ScanId : "myScan"
ExportedReportLocation : "https://myaccount.blob.core.windows.net/vulnerabilityAssessment/ManagedInstance01/Database01/scan_myScan.xlsx"
$connection_string_to_storage_account = "DefaultEndpointsProtocol=https;AccountName=myaccount...."
$converted_scan_results_download_local_folder = "C:\Downloads\"
$storage_account_context = New-AzStorageContext -ConnectionString $connection_string_to_storage_account
$convert_scan_result_splitted = $convert_scan_results.ExportedReportLocation -split "/"
$container_name = $convert_scan_result_splitted[3]
Get-AzStorageBlobContent -Blob ($a -split $container_name + '/')[1] `
-Container $container_name `
-Destination $converted_scan_results_download_local_folder `
-Context $storage_account_context
示例 2 - 从扫描记录转换漏洞评估扫描结果
Get-AzSqlInstanceDatabaseVulnerabilityAssessmentScanRecord `
-ResourceGroupName "ResourceGroup01" `
-InstanceName "ManagedInstance01" `
-DatabaseName "Database01" `
-ScanId "myScan" `
| Convert-AzSqlInstanceDatabaseVulnerabilityAssessmentScan
ResourceGroupName : "ResourceGroup01"
InstanceName : "ManagedInstance01"
DatabaseName : "Database01"
ScanId : "myScan"
ExportedReportLocation : "https://myaccount.blob.core.windows.net/vulnerabilityAssessment/ManagedInstance01/Database01/scan_myScan.xlsx"
参数
-Confirm
提示你在运行 cmdlet 之前进行确认。
类型: | SwitchParameter |
别名: | cf |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DatabaseName
SQL 托管数据库名称。
类型: | String |
Position: | 2 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
类型: | IAzureContextContainer |
别名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-InputObject
要用于转换漏洞评估扫描的扫描记录对象
类型: | VulnerabilityAssessmentScanRecordModel |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-InstanceName
SQL 托管实例名称。
类型: | String |
Position: | 1 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-ResourceGroupName
资源组的名称。
类型: | String |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-ScanId
指定扫描 ID。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-WhatIf
显示运行该 cmdlet 时会发生什么情况。 cmdlet 未运行。
类型: | SwitchParameter |
别名: | wi |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
输入
VulnerabilityAssessmentScanRecordModel