< Back

Enable-AzureRmActivityLogAlert

Tue Jan 29, 2019 9:48 pm

NAME Enable-AzureRmActivityLogAlert



SYNOPSIS

Enables an activity log alert and sets its Tags.





SYNTAX

Enable-AzureRmActivityLogAlert [-DefaultProfile <IAzureContextContainer>] -InputObject <PSActivityLogAlertResource> [-Confirm] [-WhatIf]

[<CommonParameters>]



Enable-AzureRmActivityLogAlert [-DefaultProfile <IAzureContextContainer>] -Name <String> -ResourceGroupName <String> [-Confirm] [-WhatIf]

[<CommonParameters>]



Enable-AzureRmActivityLogAlert [-DefaultProfile <IAzureContextContainer>] -ResourceId <String> [-Confirm] [-WhatIf] [<CommonParameters>]





DESCRIPTION

The Enable-AzureRmActivityLogAlert cmdlet allows enabling an activity log alert and setting its tags. This cmdlet implements the ShouldProcess

pattern, i.e. it might request confirmation from the user before actually patching the resource.





PARAMETERS

-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



-InputObject <PSActivityLogAlertResource>

Sets the InputObject tags property of the call to extract the required name, resource group name, and the optional tags properties.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-Name <String>

The name of the activity log alert.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ResourceGroupName <String>

The name of the resource group where the alert resource is going to exist.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ResourceId <String>

Sets the ResourceId tags property of the call to extract the required name, resource group name properties.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

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



Required? false

Position? named

Default value False

Accept pipeline input? False

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.Commands.Insights.OutputClasses.PSActivityLogAlertResource







NOTES









Example 1: Disable an activity log alert



PS C:\\>Enable-AzureRmActivityLogAlert -Name "alert1" -ResourceGroupName "Default-ActivityLogsAlerts"



This command enables the activity log alert called alert1 in the resource group Default-ActivityLogsAlerts.





Example 2: Enable an activity log alert using a PSActivityLogAlertResource object as input



PS C:\\>$obj = Get-AzureRmActivityLogAlert -ResourceGroup "Default-activityLogAlerts" -Name "alert1"

PS C:\\>Enable-AzureRmActivityLogAlert -InputObject $obj



This command enables an activity log alert called alert1. For this it uses a PSActivityLogAlertResource object as input argument.





Example 3: Enable the ActivityLogAlert using the ResourceId parameter



PS C:\\>Find-AzureRmResource -ResourceGroupEquals "myResourceGroup" -ResourceNameEquals "myLogAlert" | Enable-AzureRmActivityLogAlert



This command enables the ActivityLogAlert using the ResourceId parameter from the pipe.







RELATED LINKS

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

Set-AzureRmActivityLogAlert

Get-AzureRmActivityLogAlert

Remove-AzureRmActivityLogAlert

New-AzureRmActionGroup

New-AzureRmActivityLogAlertCondition

Disable-AzureRmActivityLogAlert