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>]
Description
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
指定掃描標識碼。
類型: | String |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | True |
接受萬用字元: | False |
-WhatIf
顯示 Cmdlet 執行時會發生什麼事。 Cmdlet 未執行。
類型: | SwitchParameter |
別名: | wi |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
輸入
VulnerabilityAssessmentScanRecordModel