Share via


New-MgBetaDeviceManagementMonitoringAlertRule

Create an alertRule object.

Syntax

CreateExpanded (Default)

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>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Create

New-MgBetaDeviceManagementMonitoringAlertRule
    -BodyParameter <IMicrosoftGraphDeviceManagementAlertRule>
    [-ResponseHeadersVariable <String>]
    [-Headers <IDictionary>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

Create an alertRule object.

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 = "serena.davis@contoso.com"
				}
			)
		}
	)
}

New-MgBetaDeviceManagementMonitoringAlertRule -BodyParameter $params

This example shows how to use the New-MgBetaDeviceManagementMonitoringAlertRule Cmdlet.

Parameters

-AdditionalProperties

Additional Parameters

Parameter properties

Type:Hashtable
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

CreateExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-AlertRuleTemplate

alertRuleTemplate

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

CreateExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-BodyParameter

alertRule To construct, see NOTES section for BODYPARAMETER properties and create a hash table.

Parameter properties

Type:IMicrosoftGraphDeviceManagementAlertRule
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Create
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:

IMicrosoftGraphDeviceManagementRuleCondition[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

CreateExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Description

The rule description.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

CreateExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DisplayName

The display name of the rule.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

CreateExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False

Parameter sets

CreateExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Headers

Optional headers that will be added to the request.

Parameter properties

Type:IDictionary
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Id

The unique identifier for an entity. Read-only.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

CreateExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False

Parameter sets

CreateExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:

IMicrosoftGraphDeviceManagementNotificationChannel[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

CreateExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ResponseHeadersVariable

Optional Response Headers Variable.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:RHV

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Severity

ruleSeverityType

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

CreateExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Threshold

ruleThreshold To construct, see NOTES section for THRESHOLD properties and create a hash table.

Parameter properties

Type:IMicrosoftGraphDeviceManagementRuleThreshold
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

CreateExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

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 serena.davis@contoso.com 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 serena.davis@contoso.com.
      • [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 serena.davis@contoso.com 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 serena.davis@contoso.com.
    • [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.