Forum Discussion
dolphin168
Oct 02, 2021Copper Contributor
List of backup more than 90 days
Hi, We have setup VM monthly backup with 12 months retention in Azure, how to list out the old backup records?
Ankit Kotnala
Oct 03, 2021Brass Contributor
You can use below powershell commandlet
Get-AzRecoveryServicesBackupRecoveryPoint Here is a sample script you can run, change the start and end date as per your need:
$vmName = ""
$vaultName = ""
$vaultId = (Get-AzREcoveryServicesVault -Name $vaultName).ID
$Container = Get-AzRecoveryServicesBackupContainer -ContainerType AzureVM -Status Registered -VaultId $vaultId -FriendlyName $vmName
$item = Get-AzRecoveryServicesBackupItem -Container $Container -WorkloadType AzureVM -VaultId $vaultId
$startDate = (Get-Date).AddDays(-27)
$endDate = (Get-Date).AddDays(3)
Get-AzRecoveryServicesBackupRecoveryPoint -Item $item -VaultId $vaultId -StartDate $startDate.ToUniversalTime() -EndDate $endDate.ToUniversalTime()