Edit

Share via


New-AzAlertRuleEmail

Creates an email action for an alert rule.

Syntax

Default (Default)

New-AzAlertRuleEmail
    [[-CustomEmail] <String[]>]
    [-SendToServiceOwner]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

Description

The New-AzAlertRuleEmail cmdlet creates an e-mail action for an alert rule.

Examples

Example 1: Create an alert rule email action for service owners

New-AzAlertRuleEmail -SendToServiceOwner

This command creates an alert rule email action to send for its service owners when an alert rule is fired.

Example 2: Create an alert rule email action for non-service owners

New-AzAlertRuleEmail -CustomEmail pattif@contoso.com,davidchew@contoso.net

This command creates an alert rule email action for the specified email addresses, but not for the service owners.

Example 3: Create an alert rule email action for service owners and non-service owners

New-AzAlertRuleEmail -CustomEmail pattif@contoso.net -SendToServiceOwner

This command creates an alert rule email action for the specified address and for its service owners.

Parameters

-CustomEmail

Specifies a list of comma-separated e-mail addresses.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

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

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

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

-SendToServiceOwner

Indicates that this operation sends an e-mail to the service owners when the rule fires.

Parameter properties

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

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
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

String

SwitchParameter

Outputs

RuleEmailAction