Modifier

Partager via


Set-AzSecurityPricing

Enables or disables Microsoft Defender plans for a subscription in Microsoft Defender for Cloud.

Note

For CloudPosture (Defender Cloud Security Posture Management), the agentless extensions will not be enabled when using this command. To enable extensions, please use the Azure Policy definition or scripts in the Microsoft Defender for Cloud Community Repository.

Syntax

Set-AzSecurityPricing
   -Name <String>
   -PricingTier <String>
   [-SubPlan <String>]
   [-Extension <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzSecurityPricing
   -InputObject <PSSecurityPricing>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Enable or disable any of the Azure Defender plans for a subscription.

For details about Azure Defender and the available plans, see Introduction to Azure Defender.

Examples

Example 1

Set-AzSecurityPricing -Name "AppServices" -PricingTier "Standard"

Example 2

Set-AzSecurityPricing -Name "VirtualMachines" -PricingTier "Standard" -SubPlan P2

Example 3

Set-AzSecurityPricing -Name "CloudPosture" -PricingTier "Standard" -Extension '[{"name":"SensitiveDataDiscovery","isEnabled":"True","additionalExtensionProperties":null},{"name":"ContainerRegistriesVulnerabilityAssessments","isEnabled":"True","additionalExtensionProperties":null},{"name":"AgentlessDiscoveryForKubernetes","isEnabled":"True","additionalExtensionProperties":null},{"name":"AgentlessVmScanning","isEnabled":"True","additionalExtensionProperties":{"ExclusionTags":"[{\"key\":\"Microsoft\",\"value\":\"Defender\"},{\"key\":\"For\",\"value\":\"Cloud\"}]"}}]'

Enables Azure Defender for servers for the subscription.

"Standard" refers to the "On" state for an Azure Defender plan as shown in Azure Security Center's pricing and settings area of the Azure portal.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Extension

The extensions offered under the plan

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

Input Object.

Type:PSSecurityPricing
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Name

Resource name.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-PricingTier

Pricing Tier.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-SubPlan

Sub Plan.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

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

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

PSSecurityPricing

Outputs

PSSecurityPricing