Convert-AzSqlDatabaseVulnerabilityAssessmentScan
將弱點評估掃描結果轉換為 Excel 格式。
語法
Convert-AzSqlDatabaseVulnerabilityAssessmentScan
[-ServerName] <String>
[-DatabaseName] <String>
[-InputObject <VulnerabilityAssessmentScanRecordModel>]
[-ScanId <String>]
[-ResourceGroupName] <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
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 之前,提示您進行確認。
類型: | SwitchParameter |
別名: | cf |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-DatabaseName
SQL Database 名稱。
類型: | 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 |
-ResourceGroupName
資源群組的名稱。
類型: | String |
Position: | 0 |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-ScanId
指定掃描標識碼。
類型: | String |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | True |
接受萬用字元: | False |
-ServerName
SQL Database 伺服器名稱。
類型: | String |
Position: | 1 |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-WhatIf
顯示 Cmdlet 執行時會發生什麼事。 Cmdlet 未執行。
類型: | SwitchParameter |
別名: | wi |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
輸入
VulnerabilityAssessmentScanRecordModel