你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Set-AzAlertsSuppressionRule
创建或更新警报抑制规则。
语法
Set-AzAlertsSuppressionRule
-Name <String>
-AlertType <String>
[-ExpirationDateUtc <DateTime>]
-Reason <String>
-State <PSRuleState>
[-Comment <String>]
[-SuppressionAlertsScope <PSSuppressionAlertsScope>]
[-AllOf <PSIScopeElement[]>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-AzAlertsSuppressionRule
-InputObject <PSAlertsSuppressionRule>
[-Name <String>]
[-AlertType <String>]
[-ExpirationDateUtc <DateTime>]
[-Reason <String>]
[-State <PSRuleState>]
[-Comment <String>]
[-SuppressionAlertsScope <PSSuppressionAlertsScope>]
[-AllOf <PSIScopeElement[]>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
创建或更新警报抑制规则。
示例
示例 1
Set-AzAlertsSuppressionRule -Name "Example" -State Enabled -Comment "Example of a comment" -AlertType "AzureDNS_CurrencyMining" -Reason "Other" -AllOf @([Microsoft.Azure.Commands.Security.Models.AlertsSuppressionRules.PSScopeElementContains]::new("entities.account.name", "example")) -ExpirationDateUtc 2024-10-17T15:02:24.7511441Z
上面的示例创建一个新的抑制规则,其名称为“Example”,以抑制类型(数字资产挖掘活动)[https://learn.microsoft.com/en-us/azure/defender-for-cloud/alerts-reference] 的警报,其中包含“example”作为其帐户名称的一部分。
参数
-AlertType
要取消的警报类型。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-AllOf
使用特定实体限定抑制规则的范围。
类型: | PSIScopeElement[] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Comment
评论。
类型: | String |
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 |
-ExpirationDateUtc
设置规则的过期数据,应采用 UTC 格式。
类型: | Nullable<T>[DateTime] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-InputObject
输入对象。
类型: | PSAlertsSuppressionRule |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-Name
警报抑制规则名称,每个订阅需要唯一。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-Reason
创建抑制规则的原因。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-State
规则的状态,已启用/禁用
类型: | PSRuleState |
接受的值: | Enabled, Disabled, Expired, Enabled, Disabled, Expired |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-SuppressionAlertsScope
使用特定实体限定抑制规则的范围。
类型: | PSSuppressionAlertsScope |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-WhatIf
显示 cmdlet 运行时会发生什么情况。 cmdlet 未运行。
类型: | SwitchParameter |
别名: | wi |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |