The Get-AzRecoveryServicesBackupItem cmdlet gets the list of protected items in a container and the protection status of the items.
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.
The first command gets the container of type AzureVM, and then stores it in the $Container variable.
The second command gets the Backup item named V2VM in $Container, and then stores it in the $BackupItem variable.
Example 2: Get an Azure File Share Item from FriendlyName
The first command gets the container of type AzureStorage, and then stores it in the $Container variable.
The second command gets the Backup item whose friendlyName matches the value passed in FriendlyName Parameter, and then stores it in the $BackupItem variable.
Using FriendlyName parameter can result in returning more than one Azure File Share. In such cases, execute the cmdlet by passing value for -Name parameter as the Name property returned in the result set of $BackupItem.
Example 3: List soft-deleted Azure File Share items
Lists Azure File Share backup items that have been disabled with Disable-AzRecoveryServicesBackupProtection -RemoveRecoveryPoints and are currently in the soft-deleted state. These items can be rehydrated with Undo-AzRecoveryServicesBackupItemDeletion while still within the soft-delete retention window.
Example 4: Get an Azure File Share Item from the secondary region (Cross Region Restore)
The returned item can be used with Get-AzRecoveryServicesBackupRecoveryPoint -UseSecondaryRegion and Restore-AzRecoveryServicesBackupItem -RestoreToSecondaryRegion to perform a Cross Region Restore.
Parameters
-BackupManagementType
The class of resources being protected. The acceptable values for this parameter are:
Specifies a container object from which this cmdlet gets backup items.
To obtain an AzureRmRecoveryServicesBackupContainer, use the Get-AzRecoveryServicesBackupContainer cmdlet.
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters.
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.