< Back

Disable-AzureRmActivityLogAlert

Tue Jan 29, 2019 9:48 pm

NAME Disable-AzureRmActivityLogAlert



SYNOPSIS

Disables an activity log alert and sets its tags.





SYNTAX

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

[<CommonParameters>]



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

[<CommonParameters>]



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





DESCRIPTION

The Disable-AzureRmActivityLogAlert cmdlet disables and activity log alert and allows 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 tag 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:\\>Disable-AzureRmActivityLogAlert -Name "alert1" -ResourceGroupName "Default-ActivityLogsAlerts"



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



This command changes the tags property of the activity log alert called alert1 and disables it.





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



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

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



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





Example 3: Disable the ActivityLogAlert using the ResourceId parameter



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



This command disables 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

Enable-AzureRmActivityLogAlert