Undo-AzRecoveryServicesBackupItemDeletion
If a backup item is deleted and present in a soft-deleted state, this command brings the item back to a state where the data is retained forever
Note
This is the previous version of our documentation. Please consult the most recent version for up-to-date information.
Syntax
Undo-AzRecoveryServicesBackupItemDeletion
[-Item] <ItemBase>
[-Force]
[-VaultId <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Undo-AzRecoveryServicesBackupItemDeletion cmdlet reverts a soft-deleted item to a state where the protection is stopped but data is retained forever.
Examples
Example 1
$Cont = Get-AzRecoveryServicesBackupContainer -ContainerType AzureVM
$PI = Get-AzRecoveryServicesBackupItem -Container $Cont[0] -WorkloadType AzureVM
Disable-AzRecoveryServicesBackupProtection -Item $PI[0] -RemoveRecoveryPoints
$PI = Get-AzRecoveryServicesBackupItem -Container $Cont[0] -WorkloadType AzureVM | Where-Object {$_.DeleteState -eq "ToBeDeleted"}
Undo-AzRecoveryServicesBackupItemDeletion -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 third command disables Backup protection for the item in $PI[0] and puts the item in a softdeleted state. The fourth command gets the item which is in a softdeleted state. The last command brings the softdeleted VM to a state where the protection is stopped but data is retained forever.
Example 2
Rehydrates a soft-deleted Item. (autogenerated)
Undo-AzRecoveryServicesBackupItemDeletion -Item $PI[0] -VaultId $vault.ID
Parameters
Prompts you for confirmation before running the cmdlet.
| Type: | SwitchParameter |
| Aliases: | cf |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The credentials, account, tenant, and subscription used for communication with Azure.
| Type: | IAzureContextContainer |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Force disables backup protection (prevents confirmation dialog). This parameter is optional.
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the backup item for which this cmdlet reverts the deletion. To obtain an AzureRmRecoveryServicesBackupItem , use the Get-AzRecoveryServicesBackupItem cmdlet.
| Type: | ItemBase |
| Position: | 1 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
ARM ID of the Recovery Services Vault.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs. The cmdlet is not run.
| Type: | SwitchParameter |
| Aliases: | wi |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |