question

SivaSankaraRao avatar image
0 Votes"
SivaSankaraRao asked LimitlessTechnology-2700 answered

Azure backup server protected items list using powershell script

Good Morning,

I'm looking for a PowerShell script to get the list of all protected items with all property details like (backup item, item type, protected server, backup management, last recovery point, etc..) in the azure recovery service vault for the azure backup server. I'm using the below cmd but it fetches only the registered backup servers list not all the protected items listed inside them. please can you assist me with this? thanks in advance

$backupServersMARS = Get-AzRecoveryServicesBackupContainer -ContainerType "Windows" -BackupManagementType MAB -VaultId $RCvault.ID

$backupServersMARS

windows-server-powershellazure-backupazure-site-recovery
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

LimitlessTechnology-2700 avatar image
0 Votes"
LimitlessTechnology-2700 answered

Hi there,

It seems you have not set the -VaultId parameter correctly to get the expected result.

A container that is registered to an Azure Recovery Services vault can have one or more items that can be protected. For Azure virtual machines, there can be only one backup item in the virtual machine container. Set the vault context by using the -VaultId parameter.

You can read more about this from the below article
Get-AzRecoveryServicesBackupItem https://docs.microsoft.com/en-us/powershell/module/az.recoveryservices/get-azrecoveryservicesbackupitem?view=azps-7.5.0

Azure Backup PowerShell samples https://docs.microsoft.com/en-us/azure/backup/powershell-backup-samples



--If the reply is helpful, please Upvote and Accept it as an answer–

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.