Edit

Share via


Disable-AzRecoveryServicesBackupProtection

Disables protection for a Backup-protected item.

Syntax

Default (Default)

Disable-AzRecoveryServicesBackupProtection
    [-Item] <ItemBase>
    [-RemoveRecoveryPoints]
    [-RetainRecoveryPointsAsPerPolicy]
    [-Force]
    [-VaultId <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [-Token <String>]
    [-SecureToken <SecureString>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Disable-AzRecoveryServicesBackupProtection cmdlet disables protection for an Azure Backup-protected item. This cmdlet stops regular scheduled backup of an item and retain forever. This cmdlet can also delete existing recovery points for the backup item if executed with RemoveRecoveryPoints parameter. This cmdlet can suspend backup of an item and retain recovery points as per backup policy if used with RetainRecoveryPointsAsPerPolicy parameter. One condition with this scenario is that backups can't be suspended until immutability is enabled on the vault. To enable immutability on a recovery services vault, pls follow Update-AzRecoveryServicesVault cmdlet. Set the vault context by using the Set-AzRecoveryServicesVaultContext cmdlet before you use the current cmdlet.

Examples

Example 1: Disable Backup protection

$Cont = Get-AzRecoveryServicesBackupContainer -ContainerType AzureVM
$PI = Get-AzRecoveryServicesBackupItem -Container $Cont[0] -WorkloadType AzureVM
Disable-AzRecoveryServicesBackupProtection -Item $PI[0]

The first command gets an array of backup containers, and then stores it in the $Cont array. The second command gets the Backup item corresponding to the first container item, and then stores it in the $PI variable. The last command disables Backup protection for the item in $PI[0], but retains the data.

Example 2

Disables protection for a Backup-protected item. (autogenerated)

Disable-AzRecoveryServicesBackupProtection -Item $PI[0] -RemoveRecoveryPoints -VaultId $vault.ID

Example 3: Disable protection with retain recovery points as per policy

$item = Get-AzRecoveryServicesBackupItem -VaultId $suspendVault.ID -BackupManagementType AzureVM -WorkloadType AzureVM
Disable-AzRecoveryServicesBackupProtection -Item $item[0] -RetainRecoveryPointsAsPerPolicy -VaultId $vault.ID -Force
$item = Get-AzRecoveryServicesBackupItem -VaultId $suspendVault.ID -BackupManagementType AzureVM -WorkloadType AzureVM
 $item[0].ProtectionState
BackupsSuspended

The first cmdlet fetches the AzureVM backup items for the recovery services vault. The second cmdlet is used to suspend backup for $item[0] of the recovery services vault. One condition with this scenario is that backups can't be suspended until immutability is enabled on the vault. To enable immutability on a recovery services vault, pls follow Update-AzRecoveryServicesVault cmdlet. The third and fourth command are used to fetch the updated backup item and its protection state. To resume protection back, please use Enable-AzRecoveryServicesBackupProtection with parameter -Item.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DefaultProfile

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

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Force

Forces the command to run without asking for user confirmation.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Item

Specifies the Backup item for which this cmdlet disables protection. To obtain an AzureRmRecoveryServicesBackupItem, use the Get-AzRecoveryServicesBackupItem cmdlet.

Parameter properties

Type:ItemBase
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:1
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-RemoveRecoveryPoints

Indicates that this cmdlet deletes existing recovery points.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:2
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RetainRecoveryPointsAsPerPolicy

If this option is used, all the recovery points for this item will expire as per the retention policy. Please note that this parameter works only on Recovery Services Vaults that have the Immutability feature enabled.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SecureToken

Parameter to authorize operations protected by cross tenant resource guard. Use command (Get-AzAccessToken -TenantId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx").Token to fetch authorization token for different tenant

Parameter properties

Type:SecureString
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Token

Auxiliary access token for authenticating critical operation to resource guard subscription

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-VaultId

ARM ID of the Recovery Services Vault.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

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

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Inputs

ItemBase

String

Outputs

JobBase