Find-AzDataProtectionRestorableTimeRange

Finds the valid recovery point in time ranges for the restore.

Syntax

Find-AzDataProtectionRestorableTimeRange
    -BackupInstanceName <String>
    -ResourceGroupName <String>
    -VaultName <String>
    [-SubscriptionId <String>]
    -SourceDataStoreType <RestoreSourceDataStoreType>
    [-EndTime <String>]
    [-StartTime <String>]
    [-DefaultProfile <PSObject>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

Finds the valid recovery point in time ranges for the restore.

Examples

Example 1: Fetch valid restorable time ranges for a BackupInstance

$startTime = (Get-Date).AddDays(-30).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
$endTime = (Get-Date).AddDays(0).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
$instances = Search-AzDataProtectionBackupInstanceInAzGraph -Subscription "subscriptionId" -DatasourceType AzureBlob -ResourceGroup "rgName" -Vault "vaultName"
$pointInTimeRange = Find-AzDataProtectionRestorableTimeRange -BackupInstanceName $instances[0].BackupInstanceName -ResourceGroupName "rgName" -SubscriptionId "subscriptionId"  -VaultName "vaultName" -SourceDataStoreType OperationalStore -StartTime $startTime -EndTime $endTime
$pointInTimeRange.RestorableTimeRange | Format-List

EndTime    : 2021-04-24T08:57:36.4149422Z
ObjectType : RestorableTimeRange
StartTime  : 2021-03-25T14:27:31.0000000Z

Set $startTime and $endTime. Fetch the backup instance. Fetch valid time ranges for Backup Instance $instance[0]. Dispaly RestorableTimeRange, note that this can be multiple dicrete ranges.

Parameters

-BackupInstanceName

The name of the backup instance.

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

-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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.

Type:PSObject
Aliases:AzureRMContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-EndTime

End time for the List Restore Ranges request. ISO 8601 format.

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

-ResourceGroupName

The name of the resource group. The name is case insensitive.

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

-SourceDataStoreType

Gets or sets the type of the source data store.

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

-StartTime

Start time for the List Restore Ranges request. ISO 8601 format.

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

-SubscriptionId

The ID of the target subscription. The value must be an UUID.

Type:String
Position:Named
Default value:(Get-AzContext).Subscription.Id
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-VaultName

The name of the backup vault.

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

Outputs

IAzureBackupFindRestorableTimeRangesResponseResource