Convert-AzSqlDatabaseVulnerabilityAssessmentScan
语法
Default (默认值)
Convert-AzSqlDatabaseVulnerabilityAssessmentScan
[-ServerName] <String>
[-DatabaseName] <String>
[-InputObject <VulnerabilityAssessmentScanRecordModel>]
[-ScanId <String>]
[-ResourceGroupName] <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
Convert-AzSqlDatabaseVulnerabilityAssessmentScan cmdlet 将驻留在客户存储中的扫描结果(由 ScanId 参数标识)转换为存储在由 Set-AzSqlServerVulnerabilityAssessmentSettings cmdlet 定义的存储中的 Excel 格式。
请注意,需要运行 Enable-AzSqlServerAdvancedDataSecurity 和 Update-AzSqlServerVulnerabilityAssessmentSetting cmdlet 作为使用此 cmdlet 的先决条件。
示例
示例 1:转换漏洞评估扫描结果并将其保存到本地磁盘
Update-AzSqlServerVulnerabilityAssessmentSetting `
-ResourceGroupName "ResourceGroup01" `
-ServerName "Server01" `
-StorageAccountName "mystorage"
Start-AzSqlDatabaseVulnerabilityAssessmentScan `
-ResourceGroupName "ResourceGroup01" `
-ServerName "Server01" `
-DatabaseName "Database01" `
-ScanId "myScan"
$convert_scan_results = Convert-AzSqlDatabaseVulnerabilityAssessmentScan `
-ResourceGroupName "ResourceGroup01" `
-ServerName "Server01" `
-DatabaseName "Database01" `
-ScanId "myScan"
ResourceGroupName : "ResourceGroup01"
ServerName : "Server01"
DatabaseName : "Database01"
ScanId : "myScan"
ExportedReportLocation : "https://myaccount.blob.core.windows.net/vulnerabilityAssessment/Server01/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-AzSqlDatabaseVulnerabilityAssessmentScanRecord `
-ResourceGroupName "ResourceGroup01" `
-ServerName "Server01" `
-DatabaseName "Database01" `
-ScanId "myScan" `
| Convert-AzSqlDatabaseVulnerabilityAssessmentScan
ResourceGroupName : "ResourceGroup01"
ServerName : "Server01"
DatabaseName : "Database01"
ScanId : "myScan"
ExportedReportLocation : "https://myaccount.blob.core.windows.net/vulnerabilityAssessment/Server01/Database01
/scan_myScan.xlsx"
参数
-Confirm
在运行 cmdlet 之前,提示你进行确认。
参数属性
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-DatabaseName
SQL 数据库名称。
参数属性
| 类型: | String
|
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | 2 |
| 必需: | True |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
参数属性
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
要用于转换漏洞评估扫描的扫描记录对象
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | True |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-ResourceGroupName
资源组的名称。
参数属性
| 类型: | String
|
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | 0 |
| 必需: | True |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-ScanId
指定扫描 ID。
参数属性
| 类型: | String
|
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-ServerName
SQL 数据库服务器名称。
参数属性
| 类型: | String
|
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | 1 |
| 必需: | True |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-WhatIf
显示 cmdlet 运行时会发生什么情况。 命令脚本未运行。
参数属性
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
CommonParameters
此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters。
输出