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

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

-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

-Force

Force disables backup protection (prevents confirmation dialog). This parameter is optional.

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

-Item

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
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-VaultId

ARM ID of the Recovery Services Vault.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
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

ItemBase

String

Outputs

JobBase