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.
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)
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.
Specifies the Backup item for which this cmdlet disables protection.
To obtain an AzureRmRecoveryServicesBackupItem, use the Get-AzRecoveryServicesBackupItem cmdlet.
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 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
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.
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.