List of backup more than 90 days

%3CLINGO-SUB%20id%3D%22lingo-sub-2806372%22%20slang%3D%22en-US%22%3EList%20of%20backup%20more%20than%2090%20days%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2806372%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20have%20setup%20VM%20monthly%20backup%20with%2012%20months%20retention%20in%20Azure%2C%20how%20to%20list%20out%20the%20old%20backup%20records%3F%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2807018%22%20slang%3D%22en-US%22%3ERe%3A%20List%20of%20backup%20more%20than%2090%20days%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2807018%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1173311%22%20target%3D%22_blank%22%3E%40dolphin168%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20can%20use%20below%20powershell%20commandlet%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3EGet-AzRecoveryServicesBackupRecoveryPoint%20%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3BHere%20is%20a%20sample%20script%20you%20can%20run%2C%20change%20the%20start%20and%20end%20date%20as%20per%20your%20need%3A%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3E%24vmName%20%3D%20%22%22%0A%24vaultName%20%3D%20%22%22%0A%0A%24vaultId%20%3D%20(Get-AzREcoveryServicesVault%20-Name%20%24vaultName).ID%0A%0A%24Container%20%3D%20Get-AzRecoveryServicesBackupContainer%20-ContainerType%20AzureVM%20-Status%20Registered%20-VaultId%20%24vaultId%20-FriendlyName%20%24vmName%0A%0A%24item%20%3D%20Get-AzRecoveryServicesBackupItem%20-Container%20%24Container%20-WorkloadType%20AzureVM%20-VaultId%20%24vaultId%0A%24startDate%20%3D%20(Get-Date).AddDays(-27)%0A%24endDate%20%3D%20(Get-Date).AddDays(3)%0A%0AGet-AzRecoveryServicesBackupRecoveryPoint%20-Item%20%24item%20-VaultId%20%24vaultId%20-StartDate%20%24startDate.ToUniversalTime()%20-EndDate%20%24endDate.ToUniversalTime()%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hi,

 

We have setup VM monthly backup with 12 months retention in Azure, how to list out the old backup records?  

1 Reply

@dolphin168 

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()