New-MgBetaDeviceManagementMonitoringAlertRule
Create an alertRule object.
Syntax
New-MgBetaDeviceManagementMonitoringAlertRule
[-ResponseHeadersVariable <String>]
[-AdditionalProperties <Hashtable>]
[-AlertRuleTemplate <String>]
[-Conditions <IMicrosoftGraphDeviceManagementRuleCondition[]>]
[-Description <String>]
[-DisplayName <String>]
[-Enabled]
[-Id <String>]
[-IsSystemRule]
[-NotificationChannels <IMicrosoftGraphDeviceManagementNotificationChannel[]>]
[-Severity <String>]
[-Threshold <IMicrosoftGraphDeviceManagementRuleThreshold>]
[-Headers <IDictionary>]
[-ProgressAction <ActionPreference>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-MgBetaDeviceManagementMonitoringAlertRule
-BodyParameter <IMicrosoftGraphDeviceManagementAlertRule>
[-ResponseHeadersVariable <String>]
[-Headers <IDictionary>]
[-ProgressAction <ActionPreference>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Create an alertRule object.
Permissions
Permission type | Least privileged permissions | Higher privileged permissions |
---|---|---|
Delegated (work or school account) | CloudPC.ReadWrite.All | Not available. |
Delegated (personal Microsoft account) | Not supported. | Not supported. |
Application | Not supported. | Not supported. |
Examples
Example 1: Code snippet
Import-Module Microsoft.Graph.Beta.DeviceManagement
$params = @{
id = "215c55cc-b1c9-4d36-a870-be5778101714"
displayName = "Azure network connection failure impacting Cloud PCs"
severity = "informational"
isSystemRule = $true
description = "Azure network connection checks have failed and is potentially impacting existing Cloud PCs and blocking the provisioning of new Cloud PCs"
enabled = $true
alertRuleTemplate = "cloudPcOnPremiseNetworkConnectionCheckScenario"
threshold = @{
aggregation = "count"
operator = "greaterOrEqual"
target = 90
}
conditions = @(
@{
relationshipType = "or"
conditionCategory = "azureNetworkConnectionCheckFailures"
aggregation = "count"
operator = "greaterOrEqual"
thresholdValue = "90"
}
)
notificationChannels = @(
@{
notificationChannelType = "portal"
notificationReceivers = @(
)
}
@{
notificationChannelType = "email"
notificationReceivers = @(
@{
locale = "en-us"
contactInformation = "[email protected]"
}
)
}
)
}
New-MgBetaDeviceManagementMonitoringAlertRule -BodyParameter $params
This example shows how to use the New-MgBetaDeviceManagementMonitoringAlertRule Cmdlet.
Parameters
-AdditionalProperties
Additional Parameters
Type: | Hashtable |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-AlertRuleTemplate
alertRuleTemplate
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-BodyParameter
alertRule To construct, see NOTES section for BODYPARAMETER properties and create a hash table.
Type: | IMicrosoftGraphDeviceManagementAlertRule |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Conditions
The conditions that determine when to send alerts. For example, you can configure a condition to send an alert when provisioning fails for six or more Cloud PCs. To construct, see NOTES section for CONDITIONS properties and create a hash table.
Type: | IMicrosoftGraphDeviceManagementRuleCondition[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Description
The rule description.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DisplayName
The display name of the rule.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Enabled
The status of the rule that indicates whether the rule is enabled or disabled. If true, the rule is enabled; otherwise, the rule is disabled.
Type: | SwitchParameter |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Headers
Optional headers that will be added to the request.
Type: | IDictionary |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Id
The unique identifier for an entity. Read-only.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IsSystemRule
Indicates whether the rule is a system rule. If true, the rule is a system rule; otherwise, the rule is a custom-defined rule and can be edited. System rules are built in and only a few properties can be edited.
Type: | SwitchParameter |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-NotificationChannels
The notification channels of the rule selected by the user. To construct, see NOTES section for NOTIFICATIONCHANNELS properties and create a hash table.
Type: | IMicrosoftGraphDeviceManagementNotificationChannel[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ProgressAction
{{ Fill ProgressAction Description }}
Type: | ActionPreference |
Aliases: | proga |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ResponseHeadersVariable
Optional Response Headers Variable.
Type: | String |
Aliases: | RHV |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Severity
ruleSeverityType
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Threshold
ruleThreshold To construct, see NOTES section for THRESHOLD properties and create a hash table.
Type: | IMicrosoftGraphDeviceManagementRuleThreshold |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
Microsoft.Graph.Beta.PowerShell.Models.IMicrosoftGraphDeviceManagementAlertRule
System.Collections.IDictionary
Outputs
Microsoft.Graph.Beta.PowerShell.Models.IMicrosoftGraphDeviceManagementAlertRule
Notes
COMPLEX PARAMETER PROPERTIES
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
BODYPARAMETER <IMicrosoftGraphDeviceManagementAlertRule>
: alertRule
[(Any) <Object>]
: This indicates any property can be added to this object.[Id <String>]
: The unique identifier for an entity. Read-only.[AlertRuleTemplate <String>]
: alertRuleTemplate[Conditions <IMicrosoftGraphDeviceManagementRuleCondition-
[]>]
: The conditions that determine when to send alerts. For example, you can configure a condition to send an alert when provisioning fails for six or more Cloud PCs.[Aggregation <String>]
: aggregationType[ConditionCategory <String>]
: conditionCategory[Operator <String>]
: operatorType[RelationshipType <String>]
: relationshipType[ThresholdValue <String>]
: The threshold value of the alert condition. The threshold value can be a number in string form or string like 'WestUS'.
[Description <String>]
: The rule description.[DisplayName <String>]
: The display name of the rule.[Enabled <Boolean?>]
: The status of the rule that indicates whether the rule is enabled or disabled. If true, the rule is enabled; otherwise, the rule is disabled.[IsSystemRule <Boolean?>]
: Indicates whether the rule is a system rule. If true, the rule is a system rule; otherwise, the rule is a custom-defined rule and can be edited. System rules are built in and only a few properties can be edited.[NotificationChannels <IMicrosoftGraphDeviceManagementNotificationChannel-
[]>]
: The notification channels of the rule selected by the user.[NotificationChannelType <String>]
: notificationChannelType[NotificationReceivers <IMicrosoftGraphDeviceManagementNotificationReceiver-
[]>]
: Information about the notification receivers, such as locale and contact information. For example, en-us for locale and [email protected] for contact information.[ContactInformation <String>]
: The contact information about the notification receivers, such as an email address. Currently, only email and portal notifications are supported. For portal notifications, contactInformation can be left blank. For email notifications, contactInformation consists of an email address such as [email protected].[Locale <String>]
: Defines the language and format in which the notification will be sent. Supported locale values are: en-us, cs-cz, de-de, es-es, fr-fr, hu-hu, it-it, ja-jp, ko-kr, nl-nl, pl-pl, pt-br, pt-pt, ru-ru, sv-se, tr-tr, zh-cn, zh-tw.
[Severity <String>]
: ruleSeverityType[Threshold <IMicrosoftGraphDeviceManagementRuleThreshold>]
: ruleThreshold[(Any) <Object>]
: This indicates any property can be added to this object.[Aggregation <String>]
: aggregationType[Operator <String>]
: operatorType[Target <Int32?>]
: The target threshold value.
CONDITIONS <IMicrosoftGraphDeviceManagementRuleCondition- []
>: The conditions that determine when to send alerts.
For example, you can configure a condition to send an alert when provisioning fails for six or more Cloud PCs.
[Aggregation <String>]
: aggregationType[ConditionCategory <String>]
: conditionCategory[Operator <String>]
: operatorType[RelationshipType <String>]
: relationshipType[ThresholdValue <String>]
: The threshold value of the alert condition. The threshold value can be a number in string form or string like 'WestUS'.
NOTIFICATIONCHANNELS <IMicrosoftGraphDeviceManagementNotificationChannel- []
>: The notification channels of the rule selected by the user.
[NotificationChannelType <String>]
: notificationChannelType[NotificationReceivers <IMicrosoftGraphDeviceManagementNotificationReceiver-
[]>]
: Information about the notification receivers, such as locale and contact information. For example, en-us for locale and [email protected] for contact information.[ContactInformation <String>]
: The contact information about the notification receivers, such as an email address. Currently, only email and portal notifications are supported. For portal notifications, contactInformation can be left blank. For email notifications, contactInformation consists of an email address such as [email protected].[Locale <String>]
: Defines the language and format in which the notification will be sent. Supported locale values are: en-us, cs-cz, de-de, es-es, fr-fr, hu-hu, it-it, ja-jp, ko-kr, nl-nl, pl-pl, pt-br, pt-pt, ru-ru, sv-se, tr-tr, zh-cn, zh-tw.
THRESHOLD <IMicrosoftGraphDeviceManagementRuleThreshold>
: ruleThreshold
[(Any) <Object>]
: This indicates any property can be added to this object.[Aggregation <String>]
: aggregationType[Operator <String>]
: operatorType[Target <Int32?>]
: The target threshold value.