你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
New-AzSentinelAutomationRule
创建或更新自动化规则。
语法
New-AzSentinelAutomationRule
-ResourceGroupName <String>
-WorkspaceName <String>
[-Id <String>]
[-SubscriptionId <String>]
[-Action <IAutomationRuleAction[]>]
[-DisplayName <String>]
[-Order <Int32>]
[-TriggeringLogicCondition <IAutomationRuleCondition[]>]
[-TriggeringLogicExpirationTimeUtc <DateTime>]
[-TriggeringLogicIsEnabled]
[-DefaultProfile <PSObject>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzSentinelAutomationRule
-ResourceGroupName <String>
-WorkspaceName <String>
[-Id <String>]
[-SubscriptionId <String>]
-AutomationRule <IAutomationRule>
[-DefaultProfile <PSObject>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
创建或更新自动化规则。
示例
示例 1:使用 Run Playbook 创建自动化规则
$LogicAppResourceId = Get-AzLogicApp -ResourceGroupName "myResourceGroup" -Name "Reset-AADPassword"
$automationRuleAction = [Microsoft.Azure.PowerShell.Cmdlets.SecurityInsights.Models.Api20210901Preview.AutomationRuleRunPlaybookAction]::new()
$automationRuleAction.Order = 1
$automationRuleAction.ActionType = "RunPlaybook"
$automationRuleAction.ActionConfigurationLogicAppResourceId = ($LogicAppResourceId.Id)
$automationRuleAction.ActionConfigurationTenantId = (Get-AzContext).Tenant.Id
New-AzSentinelAutomationRule -ResourceGroupName "myResourceGroup" -WorkspaceName "myWorkspaceName" -Id ((New-Guid).Guid) -Action $automationRuleAction -DisplayName "Run Playbook to reset AAD password" -Order 2 -TriggeringLogicIsEnabled
此命令创建具有 Run Playbook作的自动化规则。
示例 2:创建具有更改严重性作的自动化规则
$automationRuleAction = [Microsoft.Azure.PowerShell.Cmdlets.SecurityInsights.Models.Api20210901Preview.AutomationRuleModifyPropertiesAction]::new()
$automationRuleAction.Order = 1
$automationRuleAction.ActionType = "ModifyProperties"
$automationRuleAction.ActionConfigurationSeverity = "Low"
New-AzSentinelAutomationRule -ResourceGroupName "myResourceGroup" -WorkspaceName "myWorkspaceName" -Id ((New-Guid).Guid) -Action $automationRuleAction -DisplayName "Change severity to Low" -Order 3 -TriggeringLogicIsEnabled
此命令创建一个自动化规则,该规则具有更改严重性的作。
参数
-Action
触发自动化规则构造时要执行的作,请参阅 ACTION 属性的 NOTES 部分并创建哈希表。
类型: | IAutomationRuleAction[] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-AutomationRule
表示自动化规则。 若要构造,请参阅 AUTOMATIONRULE 属性的 NOTES 部分并创建哈希表。
类型: | IAutomationRule |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-Confirm
在运行 cmdlet 之前,提示你进行确认。
类型: | SwitchParameter |
别名: | cf |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DefaultProfile
DefaultProfile 参数不起作用。 如果对其他订阅执行 cmdlet,请使用 SubscriptionId 参数。
类型: | PSObject |
别名: | AzureRMContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DisplayName
自动化规则的显示名称
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Id
自动化规则 ID
类型: | String |
别名: | AutomationRuleId |
Position: | Named |
默认值: | (New-Guid).Guid |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Order
自动化规则的执行顺序
类型: | Int32 |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ResourceGroupName
资源组的名称。 名称不区分大小写。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-SubscriptionId
目标订阅的 ID。
类型: | String |
Position: | Named |
默认值: | (Get-AzContext).Subscription.Id |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-TriggeringLogicCondition
要评估以确定是否应在给定对象上触发自动化规则的条件
类型: | IAutomationRuleCondition[] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-TriggeringLogicExpirationTimeUtc
确定自动化规则何时自动过期并禁用。
类型: | DateTime |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-TriggeringLogicIsEnabled
确定是启用或禁用自动化规则。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-WhatIf
显示 cmdlet 运行时会发生什么情况。 命令脚本未运行。
类型: | SwitchParameter |
别名: | wi |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-WorkspaceName
工作区的名称。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |