Get-List Of Azure SQL Backup Items in Recovery Services Vault using Power Shell
Below Script provide you the list of backup items protected under recovery services vault.
Connect-AzAccount
$vault = Get-AzRecoveryServicesVault -Name "RSVNAME"
$bkp= $null
$bkp = @()
foreach($vaultlist in $vault)
{
Set-AzRecoveryServicesVaultContext -Vault $vaultlist
foreach($vault1 in $vault)
{
$bkp1 = Get-AzRecoveryServicesBackupItem -BackupManagementType AzureWorkload -WorkloadType MSSQL -VaultId $vault1.id
$backup_details_temp = New-Object psobject
$backup_details_temp = $bkp1
$bkp = $bkp+$backup_details_temp
}
}
$bkp | export-csv -Path "C:\Reports\SQL BKP REPORTS\Soldblist.csv"