Azure Backup - Retained backup jobs

Siva 646 Reputation points
2023-01-18T09:06:39.15+00:00

Hi Team,

Do we have any script to get all the retained backup job with retain till date.? with backup size.

Azure Backup
Azure Backup
An Azure backup service that provides built-in management at scale.
1,192 questions
0 comments No comments
{count} votes

Accepted answer
  1. Luke Murray 10,896 Reputation points MVP
    2023-01-22T07:47:57.6466667+00:00

    Try the below:

    
    $rsvname = "rsv-infra-prod-01"
    $infrargname = "rg-infra-prod-sc-01"
    
    $vault = Get-AzRecoveryServicesVault -Name $rsvname -ResourceGroupName $infrargname
    Set-AzRecoveryServicesVaultContext -Vault $vault
    
    
    $backupcontainer = Get-AzRecoveryServicesBackupContainer `
        -ContainerType "AzureVM" `
        -FriendlyName vmdcprod01
    
    $item = Get-AzRecoveryServicesBackupItem `
        -Container $backupcontainer `
        -WorkloadType "AzureVM"
    
    Get-AzRecoveryServicesBackupRecoveryPoint -Item $item -RecoveryPointId 7701367240882239739
    s
    
    

    Reference: [https://github.com/petitess/powershell/blob/2e7fdead5d729f4bef347a7eddd8ae74584d99d4/Azure/Get-AzRecoveryServicesBackupRecoveryPoint01.ps1#L13

    Note: I don't have any retention points in my test Azure subscription to reference against, but the Get-AzRecoveryServicesBackupRecoveryPoint cmdlet, does point to the correct one to use.

    Let me know how it goes.


0 additional answers

Sort by: Most helpful