< Back

New-AzureRmAlertRuleEmail

Tue Jan 29, 2019 9:48 pm

NAME New-AzureRmAlertRuleEmail



SYNOPSIS

Creates an email action for an alert rule.





SYNTAX

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





DESCRIPTION

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





PARAMETERS

-CustomEmail <String[]>

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



Required? false

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-DefaultProfile <IAzureContextContainer>

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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-SendToServiceOwner [<SwitchParameter>]

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



Required? false

Position? named

Default value False

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None

This cmdlet does not accept any input.





OUTPUTS

Microsoft.Azure.Management.Monitor.Management.Models.RuleEmailAction







NOTES









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



PS C:\\>New-AzureRmAlertRuleEmail -SendToServiceOwners



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



PS C:\\>New-AzureRmAlertRuleEmail -CustomEmails 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



PS C:\\>New-AzureRmAlertRuleEmail -CustomEmails pattif@contoso.net -SendToServiceOwners



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







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... truleemail

Add-AzureRmLogAlertRule

Add-AzureRmMetricAlertRule

Add-AzureRmWebtestAlertRule

New-AzureRmAlertRuleWebhook