你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Get-AzSecuritySqlVulnerabilityAssessmentScanRecord
获取 SQL 漏洞评估扫描摘要。
语法
Get-AzSecuritySqlVulnerabilityAssessmentScanRecord
[-ScanId <String>]
-ResourceId <String>
-WorkspaceId <String>
-Server <String>
-Database <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzSecuritySqlVulnerabilityAssessmentScanRecord
[-ScanId <String>]
-WorkspaceId <String>
-Server <String>
-Database <String>
-ComputerName <String>
-VmUuid <String>
-AgentId <String>
-WorkspaceResourceId <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
说明
获取 SQL 漏洞评估扫描摘要。
示例
示例 1:获取SQL 数据库最新扫描的扫描摘要。
Get-AzSecuritySqlVulnerabilityAssessmentScanRecord -WorkspaceResourceId /subscriptions/f26d1f13-67d5-4ad6-9012-67ca12d2436f/resourcegroups/ahmadtesting/providers/microsoft.operationalinsights/workspaces/ahabas-workspace -ComputerName ahabas-dev01.middleeast.corp.microsoft.com -AgentId 49640166-652f-4ee6-b48b-cfb840b8afe2 -VmUuid 4c4c4544-0030-4b10-8039-b8c04f4a3332 -WorkspaceId ba7c9d0e-a6e3-4997-b575-cf7a18a98a49 -Server AHABASDEV01SRV -Database master -ScanId "latest"
TriggerType : Recurring
State : Failed
Server : AHABASDEV01SRV
Database : master
SqlVersion : 14.0.1000.169
StartTime : 3/17/2021 1:11:10 AM
EndTime : 12/31/9999 9:59:59 PM
HighSeverityFailedRulesCount : 9
MediumSeverityFailedRulesCount : 2
LowSeverityFailedRulesCount : 5
TotalPassedRulesCount : 43
TotalFailedRulesCount : 16
TotalRulesCount : 59
IsBaselineApplied : True
Id : /subscriptions/f26d1f13-67d5-4ad6-9012-67ca12d2436f/resourcegroups/ahmadtesting/providers/microsoft.operationalinsights/workspaces/ahabas-workspace/onpremisemachines/ahabas-dev01.middleeast.corp.microsoft.com_49640166-652f-4ee6-b48b-cfb840b8afe2_4c4c4544-0030-4b10-8039-b8c04f4a3332/
sqlServers/AHABASDEV01SRV/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/bdbdf860-5d58-464b-ad9a-0125af63c162
Name : bdbdf860-5d58-464b-ad9a-0125af63c162
Type : Microsoft.Security/sqlVulnerabilityAssessments/scans
使用扫描 ID = “latest”的示例。
示例 2:获取SQL 数据库上的所有扫描摘要。
Get-AzSecuritySqlVulnerabilityAssessmentScanRecord -WorkspaceResourceId /subscriptions/f26d1f13-67d5-4ad6-9012-67ca12d2436f/resourcegroups/ahmadtesting/providers/microsoft.operationalinsights/workspaces/ahabas-workspace -ComputerName ahabas-dev01.middleeast.corp.microsoft.com -AgentId 49640166-652f-4ee6-b48b-cfb840b8afe2 -VmUuid 4c4c4544-0030-4b10-8039-b8c04f4a3332 -WorkspaceId ba7c9d0e-a6e3-4997-b575-cf7a18a98a49 -Server AHABASDEV01SRV -Database master
TriggerType : Recurring
State : Failed
Server : AHABASDEV01SRV
Database : master
SqlVersion : 14.0.1000.169
StartTime : 3/17/2021 1:11:10 AM
EndTime : 12/31/9999 9:59:59 PM
HighSeverityFailedRulesCount : 9
MediumSeverityFailedRulesCount : 2
LowSeverityFailedRulesCount : 5
TotalPassedRulesCount : 43
TotalFailedRulesCount : 16
TotalRulesCount : 59
IsBaselineApplied : True
Id : /subscriptions/f26d1f13-67d5-4ad6-9012-67ca12d2436f/resourcegroups/ahmadtesting/providers/microsoft.operationalinsights/workspaces/ahabas-workspace/onpremisemachines/ahabas-dev01.middleeast.corp.microsoft.com_49640166-652f-4ee6-b48b-cfb840b8afe2_4c4c4544-0030-4b10-8039-b8c04f4a3332/
sqlServers/AHABASDEV01SRV/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/bdbdf860-5d58-464b-ad9a-0125af63c162
Name : bdbdf860-5d58-464b-ad9a-0125af63c162
Type : Microsoft.Security/sqlVulnerabilityAssessments/scans
TriggerType : Recurring
State : Failed
Server : AHABASDEV01SRV
Database : master
SqlVersion : 14.0.1000.169
StartTime : 3/17/2021 12:41:14 AM
EndTime : 3/17/2021 1:11:10 AM
HighSeverityFailedRulesCount : 2
MediumSeverityFailedRulesCount : 0
LowSeverityFailedRulesCount : 0
TotalPassedRulesCount : 57
TotalFailedRulesCount : 2
TotalRulesCount : 59
IsBaselineApplied : True
Id : /subscriptions/f26d1f13-67d5-4ad6-9012-67ca12d2436f/resourcegroups/ahmadtesting/providers/microsoft.operationalinsights/workspaces/ahabas-workspace/onpremisemachines/ahabas-dev01.middleeast.corp.microsoft.com_49640166-652f-4ee6-b48b-cfb840b8afe2_4c4c4544-0030-4b10-8039-b8c04f4a3332/
sqlServers/AHABASDEV01SRV/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/8b2383c3-7c7e-4b6c-9b34-512ce99fd68a
Name : 8b2383c3-7c7e-4b6c-9b34-512ce99fd68a
Type : Microsoft.Security/sqlVulnerabilityAssessments/scans
TriggerType : Recurring
State : Passed
Server : AHABASDEV01SRV
Database : master
SqlVersion : 14.0.1000.169
StartTime : 2/14/2021 4:27:44 PM
EndTime : 3/17/2021 12:41:14 AM
HighSeverityFailedRulesCount : 0
MediumSeverityFailedRulesCount : 0
LowSeverityFailedRulesCount : 0
TotalPassedRulesCount : 59
TotalFailedRulesCount : 0
TotalRulesCount : 59
IsBaselineApplied : True
Id : /subscriptions/f26d1f13-67d5-4ad6-9012-67ca12d2436f/resourcegroups/ahmadtesting/providers/microsoft.operationalinsights/workspaces/ahabas-workspace/onpremisemachines/ahabas-dev01.middleeast.corp.microsoft.com_49640166-652f-4ee6-b48b-cfb840b8afe2_4c4c4544-0030-4b10-8039-b8c04f4a3332/
sqlServers/AHABASDEV01SRV/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/6845790d-6463-4f45-96e8-76286edf0267
Name : 6845790d-6463-4f45-96e8-76286edf0267
Type : Microsoft.Security/sqlVulnerabilityAssessments/scans
TriggerType : Recurring
State : Failed
Server : AHABASDEV01SRV
Database : master
SqlVersion : 14.0.1000.169
StartTime : 2/14/2021 3:57:44 PM
EndTime : 2/14/2021 4:27:44 PM
HighSeverityFailedRulesCount : 2
MediumSeverityFailedRulesCount : 0
LowSeverityFailedRulesCount : 0
TotalPassedRulesCount : 57
TotalFailedRulesCount : 2
TotalRulesCount : 59
IsBaselineApplied : True
Id : /subscriptions/f26d1f13-67d5-4ad6-9012-67ca12d2436f/resourcegroups/ahmadtesting/providers/microsoft.operationalinsights/workspaces/ahabas-workspace/onpremisemachines/ahabas-dev01.middleeast.corp.microsoft.com_49640166-652f-4ee6-b48b-cfb840b8afe2_4c4c4544-0030-4b10-8039-b8c04f4a3332/
sqlServers/AHABASDEV01SRV/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/2058a46e-cb5a-4a49-b28a-6576a540dd9d
Name : 2058a46e-cb5a-4a49-b28a-6576a540dd9d
Type : Microsoft.Security/sqlVulnerabilityAssessments/scans
如果未指定扫描 ID,则列出所有扫描记录的示例。
示例 3:使用资源 ID 参数获取扫描摘要。
Get-AzSecuritySqlVulnerabilityAssessmentScanRecord -ResourceId /subscriptions/f26d1f13-67d5-4ad6-9012-67ca12d2436f/resourcegroups/ahmadtesting/providers/microsoft.operationalinsights/workspaces/ahabas-workspace/onPremiseMachines/ahabas-dev01.middleeast.corp.microsoft.com_49640166-652f-4ee6-b48b-cfb840b8afe2_4c4c4544-0030-4b10-8039-b8c04f4a3332 -WorkspaceId ba7c9d0e-a6e3-4997-b575-cf7a18a98a49 -Server AHABASDEV01SRV -Database master -ScanId 169a5f78-acff-4e05-b597-6252af7e6677
TriggerType : Recurring
State : Failed
Server : AHABASDEV01SRV
Database : master
SqlVersion : 14.0.1000.169
StartTime : 11/18/2020 1:10:34 AM
EndTime : 11/18/2020 1:40:20 AM
HighSeverityFailedRulesCount : 9
MediumSeverityFailedRulesCount : 2
LowSeverityFailedRulesCount : 5
TotalPassedRulesCount : 43
TotalFailedRulesCount : 16
TotalRulesCount : 59
IsBaselineApplied : True
Id : /subscriptions/f26d1f13-67d5-4ad6-9012-67ca12d2436f/resourcegroups/ahmadtesting/provid
ers/microsoft.operationalinsights/workspaces/ahabas-workspace/onpremisemachines/ahabas
-dev01.middleeast.corp.microsoft.com_49640166-652f-4ee6-b48b-cfb840b8afe2_4c4c4544-003
0-4b10-8039-b8c04f4a3332/sqlServers/AHABASDEV01SRV/databases/master/providers/Microsof
t.Security/sqlVulnerabilityAssessments/default/scans/169a5f78-acff-4e05-b597-6252af7e6
677
Name : 169a5f78-acff-4e05-b597-6252af7e6677
Type : Microsoft.Security/sqlVulnerabilityAssessments/scans
使用 Azure 资源 ID 参数的示例。 支持的资源包括:
- ARC:/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.HybridCompute/machines/{machineName}
- VM:/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/{machineName}
- 本地:/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/microsoft.operationalinsights/workspaces/{workspaceName}/onPremiseMachines/{machineName}
示例 4:使用本地参数获取扫描摘要。
Get-AzSecuritySqlVulnerabilityAssessmentScanRecord -WorkspaceResourceId /subscriptions/f26d1f13-67d5-4ad6-9012-67ca12d2436f/resourcegroups/ahmadtesting/providers/microsoft.operationalinsights/workspaces/ahabas-workspace -ComputerName ahabas-dev01.middleeast.corp.microsoft.com -AgentId 49640166-652f-4ee6-b48b-cfb840b8afe2 -VmUuid 4c4c4544-0030-4b10-8039-b8c04f4a3332 -WorkspaceId ba7c9d0e-a6e3-4997-b575-cf7a18a98a49 -Server AHABASDEV01SRV -Database master -ScanId bdbdf860-5d58-464b-ad9a-0125af63c162
TriggerType : Recurring
State : Failed
Server : AHABASDEV01SRV
Database : master
SqlVersion : 14.0.1000.169
StartTime : 3/17/2021 1:11:10 AM
EndTime : 12/31/9999 9:59:59 PM
HighSeverityFailedRulesCount : 9
MediumSeverityFailedRulesCount : 2
LowSeverityFailedRulesCount : 5
TotalPassedRulesCount : 43
TotalFailedRulesCount : 16
TotalRulesCount : 59
IsBaselineApplied : True
Id : /subscriptions/f26d1f13-67d5-4ad6-9012-67ca12d2436f/resourcegroups/ahmadtesting/providers/microsoft.operationalinsights/workspaces/ahabas-workspace/onpremisemachines/ahabas-dev01.middleeast.corp.microsoft.com_49640166-652f-4ee6-b48b-cfb840b8afe2_4c4c4544-0030-4b10-8039-b8c04f4a3332/
sqlServers/AHABASDEV01SRV/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/bdbdf860-5d58-464b-ad9a-0125af63c162
Name : bdbdf860-5d58-464b-ad9a-0125af63c162
Type : Microsoft.Security/sqlVulnerabilityAssessments/scans
使用本地参数的示例。
参数
-AgentId
代理 ID - 本地参数
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-ComputerName
计算机全名 - 本地参数
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-Database
数据库名称
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
类型: | IAzureContextContainer |
别名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ResourceId
要调用其上的命令的安全资源的 ID。 支持的资源包括:
- ARC:/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.HybridCompute/machines/{machineName}
- VM:/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/{machineName}
- 本地:/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/microsoft.operationalinsights/workspaces/{workspaceName}/onPremiseMachines/{machineName}
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-ScanId
漏洞评估扫描 ID - 使用 scanId = “latest” 获取最新结果
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Server
服务器名称
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-VmUuid
虚拟机通用唯一标识符 - 本地参数
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-WorkspaceId
工作区 ID。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-WorkspaceResourceId
工作区资源 ID - 本地参数
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
输入
None