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

Start-AzSynapseSqlPoolVulnerabilityAssessmentScan

启动漏洞评估扫描。

语法

Start-AzSynapseSqlPoolVulnerabilityAssessmentScan
     [-SqlPoolObject <PSSynapseSqlPool>]
     [-AsJob]
     [-DefaultProfile <IAzureContextContainer>]
     [-WhatIf]
     [-Confirm]
     [<CommonParameters>]
Start-AzSynapseSqlPoolVulnerabilityAssessmentScan
     [-ResourceGroupName <String>]
     -WorkspaceName <String>
     -Name <String>
     [-ScanId <String>]
     [-AsJob]
     [-DefaultProfile <IAzureContextContainer>]
     [-WhatIf]
     [-Confirm]
     [<CommonParameters>]

说明

Start-AzSynapseSqlPoolVulnerabilityAssessmentScan cmdlet 使用 ScanId 标识符触发扫描。 扫描结果将保存在 Update-AzSynapseSqlPoolVulnerabilityAssessmentSetting cmdlet 定义的存储下, 在 scans/{WorkspaceName}/{Name}/scan_{ScanId}.json 可以使用带有 scanId 参数的 Get-AzSynapseSqlPoolVulnerabilityAssessmentScanRecord cmdlet 监视扫描进度,并查看状态返回的参数。 请注意,需要运行 Enable-AzSynapseSqlAdvancedThreatProtectionUpdate-AzSynapseSqlPoolVulnerabilityAssessmentSetting cmdlet 作为使用此 cmdlet 的先决条件。

示例

示例 1:启动漏洞评估扫描

Start-AzSynapseSqlPoolVulnerabilityAssessmentScan `
            -ResourceGroupName "ResourceGroup01" `
            -WorkspaceName "WorkspaceName01" `
            -Name "Name01" `
            -ScanId "myScan"

ResourceGroupName            : ResourceGroup01
WorkspaceName                : WorkspaceName01
Name                         : Name01
ScanId                       : myScan
TriggerType                  : OnDemand
State                        : Fail
StartTime                    : 6/11/2018 1:57:27 PM
EndTime                      : 6/11/2018 1:57:31 PM
Error                        : {}
ScanResultsLocationPath      : https://myaccount.blob.core.windows.net/vulnerability-assessment
                                scans/WorkspaceName01/Name01/scan_myScan.json
NumberOfFailedSecurityChecks : 9

示例 2:在没有特定扫描 ID 的情况下启动漏洞评估扫描

Start-AzSynapseSqlPoolVulnerabilityAssessmentScan `
            -ResourceGroupName "ResourceGroup01" `
            -WorkspaceName "WorkspaceName01" `
            -Name "Name01"

ResourceGroupName            : ResourceGroup01
WorkspaceName                : WorkspaceName01
Name                         : Name01
ScanId                       : 20180611_135726
TriggerType                  : OnDemand
State                        : Fail
StartTime                    : 6/11/2018 1:57:27 PM
EndTime                      : 6/11/2018 1:57:31 PM
Errors                       : {}
ScanResultsLocationPath      : https://myaccount.blob.core.windows.net/vulnerability-assessment
                                scans/WorkspaceName01/Name01/scan_myScan.json
NumberOfFailedSecurityChecks : 9

此命令从 UTC 日期时间生成格式为“yyyyMMdd_HHmmss”的扫描 ID。

示例 3:在后台启动漏洞评估扫描

$scanJob = Start-AzSynapseSqlPoolVulnerabilityAssessmentScan `
            -ResourceGroupName "ResourceGroup01" `
            -WorkspaceName "WorkspaceName01" `
            -Name "Name01" `
            -ScanId "myScan" `
            -AsJob
$scanJob | Wait-Job
$scanJob | Receive-Job

ResourceGroupName            : ResourceGroup01
WorkspaceName                : WorkspaceName01
Name                         : Name01
ScanId                       : myScan
TriggerType                  : OnDemand
State                        : Fail
StartTime                    : 6/11/2018 1:57:27 PM
EndTime                      : 6/11/2018 1:57:31 PM
Errors                       : {}
ScanResultsLocationPath      : https://myaccount.blob.core.windows.net/vulnerability-assessment
                                scans/WorkspaceName01/Name01/scan_myScan.json
NumberOfFailedSecurityChecks : 9

示例 4:使用托管 SQL 池对象启动漏洞评估扫描

Get-AzSynapseSqlPool `
            -ResourceGroupName "ResourceGroup01" `
            -WorkspaceName "WorkspaceName01" `
            -Name "Name01" `
            | Start-AzSynapseSqlPoolVulnerabilityAssessmentScan

ResourceGroupName            : ResourceGroup01
WorkspaceName                : WorkspaceName01
Name                         : Name01
ScanId                       : 20180611_135726
TriggerType                  : OnDemand
State                        : Fail
StartTime                    : 6/11/2018 1:57:27 PM
EndTime                      : 6/11/2018 1:57:31 PM
Errors                       : {}
ScanResultsLocationPath      : https://myaccount.blob.core.windows.net/vulnerability-assessment
                                scans/WorkspaceName01/Name01/scan_myScan.json
NumberOfFailedSecurityChecks : 9

示例 5:对托管实例下的所有数据库启动漏洞评估扫描

Get-AzSynapseSqlPool `
            -ResourceGroupName "ResourceGroup01" `
            -WorkspaceName "WorkspaceName01" `
            | Where-Object {$_.Name -ne "master"}  `
            | Start-AzSynapseSqlPoolVulnerabilityAssessmentScan

ResourceGroupName            : ResourceGroup01
WorkspaceName                : WorkspaceName01
Name                         : Name01
ScanId                       : 20180611_135726
TriggerType                  : OnDemand
State                        : Fail
StartTime                    : 6/11/2018 1:57:27 PM
EndTime                      : 6/11/2018 1:57:31 PM
Errors                       : {}
ScanResultsLocationPath      : https://myaccount.blob.core.windows.net/vulnerability-assessment
                                scans/WorkspaceName01/Name01/scan_myScan.json
NumberOfFailedSecurityChecks : 9


ResourceGroupName            : ResourceGroup01
WorkspaceName                : WorkspaceName01
Name                         : Name02
ScanId                       : 20180611_135726
TriggerType                  : OnDemand
State                        : Fail
StartTime                    : 6/11/2018 1:57:27 PM
EndTime                      : 6/11/2018 1:57:31 PM
Errors                       : {}
ScanResultsLocationPath      : https://myaccount.blob.core.windows.net/vulnerability-assessment
                                scans/WorkspaceName01/Name02/scan_myScan.json
NumberOfFailedSecurityChecks : 9

参数

-AsJob

在后台运行 cmdlet

类型:SwitchParameter
Position:Named
默认值:None
必需:False
接受管道输入:False
接受通配符:False

-Confirm

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

类型:SwitchParameter
别名:cf
Position:Named
默认值:None
必需:False
接受管道输入:False
接受通配符:False

-DefaultProfile

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

类型:IAzureContextContainer
别名:AzContext, AzureRmContext, AzureCredential
Position:Named
默认值:None
必需:False
接受管道输入:False
接受通配符:False

-Name

Synapse SQL 池的名称。

类型:String
Position:Named
默认值:None
必需:True
接受管道输入:True
接受通配符:False

-ResourceGroupName

资源组的名称。

类型:String
Position:Named
默认值:None
必需:False
接受管道输入:True
接受通配符:False

-ScanId

指定扫描 ID。

类型:String
Position:Named
默认值:None
必需:False
接受管道输入:True
接受通配符:False

-SqlPoolObject

要获取漏洞评估扫描记录的 sql 池对象

类型:PSSynapseSqlPool
Position:Named
默认值:None
必需:False
接受管道输入:True
接受通配符:False

-WhatIf

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

类型:SwitchParameter
别名:wi
Position:Named
默认值:None
必需:False
接受管道输入:False
接受通配符:False

-WorkspaceName

Synapse 工作区的名称。

类型:String
Position:Named
默认值:None
必需:True
接受管道输入:True
接受通配符:False

输入

PSSynapseSqlPool

String

输出

Microsoft.Azure.Commands.Synapse.Models.PSSynapseSqlPool.PSVulnerabilityAssessmentScanRecordModel