Get-AzureRmRecoveryServicesBackupItem

Gets the items from a container in Backup.

Warning

The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.

Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.

Syntax

Get-AzureRmRecoveryServicesBackupItem
   [-Container] <ContainerBase>
   [[-Name] <String>]
   [[-ProtectionStatus] <ItemProtectionStatus>]
   [[-ProtectionState] <ItemProtectionState>]
   [-WorkloadType] <WorkloadType>
   [-VaultId <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzureRmRecoveryServicesBackupItem
   [-BackupManagementType] <BackupManagementType>
   [[-Name] <String>]
   [[-ProtectionStatus] <ItemProtectionStatus>]
   [[-ProtectionState] <ItemProtectionState>]
   [-WorkloadType] <WorkloadType>
   [-VaultId <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzureRmRecoveryServicesBackupItem
   [-Policy] <PolicyBase>
   [[-Name] <String>]
   [[-ProtectionStatus] <ItemProtectionStatus>]
   [[-ProtectionState] <ItemProtectionState>]
   [-VaultId <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The Get-AzureRmRecoveryServicesBackupItem cmdlet gets the items in a container or a value in Azure Backup 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 Set-AzureRmRecoveryServicesVaultContext cmdlet before you use the current cmdlet.

Examples

Example 1: Get an item from a Backup container

PS C:\>$Container = Get-AzureRmRecoveryServicesBackupContainer -ContainerType AzureVM -Status Registered -Name "V2VM"
PS C:\> $BackupItem = Get-AzureRmRecoveryServicesBackupItem -Container $Container -WorkloadType AzureVM

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.

Parameters

-BackupManagementType

Specifies the Backup management type. The acceptable values for this parameter are:

  • AzureVM
  • MARS
  • SCDPM
  • AzureBackupServer
  • AzureSQL
  • AzureStorage
Type:BackupManagementType
Accepted values:AzureVM, MARS, SCDPM, AzureBackupServer, AzureSQL, AzureStorage
Position:1
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Container

Specifies a container object from which this cmdlet gets backup items. To obtain an AzureRmRecoveryServicesBackupContainer, use the Get-AzureRmRecoveryServicesBackupContainer cmdlet.

Type:ContainerBase
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure.

Type:IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

Specifies the name of the container.

Type:String
Position:2
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Policy

Protection policy object.

Type:PolicyBase
Position:1
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ProtectionState

Specifies the state of protection. The acceptable values for this parameter are:

  • IRPending. Initial synchronization has not started and there is no recovery point yet.
  • Protected. Protection is ongoing.
  • ProtectionError. There is a protection error.
  • ProtectionStopped. Protection is disabled.
Type:ItemProtectionState
Accepted values:IRPending, ProtectionError, Protected, ProtectionStopped
Position:4
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ProtectionStatus

Specifies the overall protection status of an item in the container. The acceptable values for this parameter are:

  • Healthy
  • Unhealthy
Type:ItemProtectionStatus
Accepted values:Healthy, Unhealthy
Position:3
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-VaultId

ARM ID of the Recovery Services Vault.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-WorkloadType

Specifies the workload type. The acceptable values for this parameter are:

  • AzureVM
  • AzureSQLDatabase
  • AzureFiles
Type:WorkloadType
Accepted values:AzureVM, AzureSQLDatabase, AzureFiles
Position:5
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

Inputs

ContainerBase

String

Parameters: VaultId (ByValue)

Outputs

ItemBase