共用方式為


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>]

Description

建立或更新警示歸並規則。

範例

範例 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” 的新隱藏規則,以隱藏類型為 (Digital currency mining activity)[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

Input 物件。

類型: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

輸入

PSAlertsSuppressionRule

輸出

PSAlertsSuppressionRule