Add-AzureRmMetricAlertRule
Written by Titus Manohar, IT security team, ManageEngine Updated on September 2025
Syntax
-WindowSize <TimeSpan>]
-Operator <ConditionOperator>
-Threshold<Double>
TargetResourceId <String>
-MetricName<String>
-TimeAggregationOperator <TimeAggregationOperator>
-Location <String>
[-Description <String>]
[-DisableRule]
-ResourceGroupName<String>
-Name<String>
-Action
[-DefaultProfile <IAzureContextContainer>]
[ <CommonParameters>]
Description
The Add-AzureRmMetricAlertRule cmdlet adds or updates a metric-based alert rule. The added rule is associated with a resource group and has a name. This cmdlet implements the ShouldProcess pattern, i.e., it might request confirmation from the user before actually creating, modifying, or removing the resource.
Required parameters
-Location
| Description | Specifies the location where the rule is defined. |
| Type | String |
| Position | Named |
| Default value | None |
| Accept pipeline input | True (ByPropertyName) |
| Accept Wildcard characters | False |
-Name
| Description | Specifies the name of the profile. |
| Type | String |
| Position | Named |
| Default value | None |
| Accept pipeline input | True (ByPropertyName) |
| Accept Wildcard characters | False |
-MetricName
| Description | Specifies the name of the metric the rule is monitoring. Specify this parameter only for metric-based rules. |
| Type | String |
| Position | Named |
| Default value | None |
| Accept pipeline input | True (ByPropertyName) |
| Accept Wildcard characters | False |
-Operator
| Description | Specifies the relational operator for the condition of the rule. |
| Type | ConditionOperator |
| Paramatere sets | GreaterThan, GreaterThanOrEqual,LessThan, LessThanOrEqual |
| Position | Named |
| Default value | None |
| Accept pipeline input | True (ByPropertyName) |
| Accept Wildcard characters | False |
-ResourceGroupName
| Description | Specifies the name of the resource group for the rule. |
| Aliases | ResourceGroup |
| Type | String |
| Position | Named |
| Default value | None |
| Accept pipeline input | True (ByPropertyName) |
| Accept Wildcard characters | False |
-TargetResourceId
| Description | Specifies the ID of the resource the rule is monitoring. This property cannot be updated for an existing alert rule. |
| Type | String |
| Position | Named |
| Default value | None |
| Accept pipeline input | True (ByPropertyName) |
| Accept Wildcard characters | False |
-Threshold
| Description | Specifies the threshold of the rule. |
| Type | Double |
| Position | Named |
| Default value | None |
| Accept pipeline input | True (ByPropertyName) |
| Accept Wildcard characters | False |
-TimeAggregationOperator
| Description | Specifies the aggregation operator to apply to the time window when the rule is being evaluated. |
| Type | TimeAggregationOperator |
| Parameter sets | Average, Minimum, Maximum, Total, Last |
| Position | Named |
| Default value | None |
| Accept pipeline input | True (ByPropertyName) |
| Accept Wildcard characters | False |
-WindowSize
| Description | Specifies the time window size for the rule to compute its data. |
| Type | TimeSpan |
| Position | Named |
| Default value | None |
| Accept pipeline input | True (ByPropertyName) |
| Accept Wildcard characters | False |
Output
Microsoft.Azure.Commands.Insights.OutputClasses.PSAddAlertRuleOperationResponse
Explore Active Directory auditing and reporting with ADAudit Plus.
- Related Products
- ADManager Plus Active Directory Management & Reporting
- ADAudit Plus Real-time Active Directory Auditing and UBA
- EventLog Analyzer Real-time Log Analysis & Reporting
- ADSelfService Plus Self-Service Password Management
- AD360 Integrated Identity & Access Management
- Log360 (On-Premise | Cloud) Comprehensive SIEM and UEBA
- AD Free Tools Active Directory FREE Tools
