Get-AzureRmBackupItem

Gets the items under 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-AzureRmBackupItem
   [-ProtectionStatus <String>]
   [-Status <String>]
   [-Type <String>]
   [-Container] <AzureRMBackupContainer>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The Get-AzureRmBackupItem cmdlet gets the items in a container in Azure Backup and the protection status of the items. Enable items for protection by using the Enable-AzureRmBackupProtection cmdlet. A container that is registered to a Backup vault can have one or more items that can be protected. For Azure virtual machines, there can be only one item in the virtual machine container.

Examples

Example 1: Get the items in a container

PS C:\>$Vault = Get-AzureRmBackupVault -Name "Vault03"
PS C:\> $Container = Get-AzureRmBackupContainer -Vault $Vault -Type AzureVM -Name "DPMSERVER.CONTOSO.COM"
PS C:\> Get-AzureRmBackupItem -Container $Container
Name                    ProtectionStatus       DataSourceStatus       RecoveryPointsCount    ProtectionPolicyName
----                    ----------------       ----------------       -------------------    --------------------
co03-vm                 NotProtected                                  0

The first command gets the vault named Vault03 by using the Get-AzureRmBackupVault cmdlet. The command stores that object in the $Vault variable. The second command gets a container that has the specified name in the vault in $Vault by using the Get-AzureRmBackupContainer cmdlet. The command stores that object in the $Container variable. The final command gets the backup item in the container in $Container.

Example 2: View all properties for an item

PS C:\>Get-AzureRmBackupItem -Container $Container | Select-Object -Property *
Name                 : co03-vm
DataSourceStatus     : 
ProtectionStatus     : NotProtected
Type                 : AzureVM
ProtectionPolicyName : 
ProtectionPolicyId   : 
RecoveryPointsCount  : 0
ItemName             : iaasvmcontainer;co03-vm;co03-vm
ContainerType        : AzureVM
ContainerUniqueName  : iaasvmcontainer;co03-vm;co03-vm
ResourceGroupName    : resourcegroup02
ResourceName         : vault03
Location             : southeastasia

This command gets the backup item in the container in $Container, and then passes it to the Select-Object cmdlet. That cmdlet returns all properties of the backup item. For more information, type Get-Help Select-Object.

Parameters

-Container

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

Type:AzureRMBackupContainer
Position:0
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

-ProtectionStatus

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

  • Protected
  • Protecting
  • NotProtected
Type:String
Accepted values:Protected, Protecting, NotProtected
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Status

Specifies the backup status for an item. The acceptable values for this parameter are: IRPending, Protected, ProtectionError, and ProtectionStopped. If the ProtectionStatus parameter has the value Protected, you can use the Status parameter value to filter items.

Type:String
Accepted values:IRPending, ProtectionStopped, ProtectionError, Protected
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Type

Specifies the type of item that this cmdlet gets. Currently, the only supported value is AzureVM.

Type:String
Accepted values:AzureVM
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

AzureRMBackupContainer

Parameters: Container (ByValue)

Outputs

AzureRMBackupItem