Disable-AzActivityLogAlert
Disables an activity log alert and sets its tags.
语法
DisableByNameAndResourceGroup
Disable-AzActivityLogAlert
-Name <String>
-ResourceGroupName <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Disable-AzActivityLogAlert
-InputObject <PSActivityLogAlertResource>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
DisableByResourceId
Disable-AzActivityLogAlert
-ResourceId <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
The Disable-AzActivityLogAlert 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.
示例
Example 1: Disable an activity log alert
PS C:\>Disable-AzActivityLogAlert -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.
PS C:\>$obj = Get-AzActivityLogAlert -ResourceGroup "Default-activityLogAlerts" -Name "alert1"
PS C:\>Disable-AzActivityLogAlert -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:\>Get-AzResource -ResourceGroupName "myResourceGroup" -Name "myLogAlert" | Disable-AzActivityLogAlert
This command disables the ActivityLogAlert using the ResourceId parameter from the pipe.
参数
-Confirm
Prompts you for confirmation before running the cmdlet.
参数属性
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with azure
参数属性
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
Sets the InputObject tags property of the call to extract the required name, resource group name, and the optional tag properties.
DisableByInputObject
Position: Named
必需: True
来自管道的值: True
来自管道的值(按属性名称): False
来自剩余参数的值: False
-Name
The name of the activity log alert.
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
DisableByNameAndResourceGroup
Position: Named
必需: True
来自管道的值: False
来自管道的值(按属性名称): True
来自剩余参数的值: False
-ResourceGroupName
The name of the resource group where the alert resource is going to exist.
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
DisableByNameAndResourceGroup
Position: Named
必需: True
来自管道的值: False
来自管道的值(按属性名称): True
来自剩余参数的值: False
-ResourceId
Sets the ResourceId tags property of the call to extract the required name, resource group name properties.
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
DisableByResourceId
Position: Named
必需: True
来自管道的值: False
来自管道的值(按属性名称): True
来自剩余参数的值: False
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
参数属性
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: 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 .
输出