Get-​Azure​Rm​Backup​Item

Gets the items under a container in Backup.

Syntax

Get-AzureRmBackupItem
   [-Container] <AzureRMBackupContainer>
   [-ProtectionStatus <String>]
   [-Status <String>]
   [-Type <String>]
   [<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.

Required 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:1
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

Optional Parameters

-ProtectionStatus

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

  • Protecting
  • NotProtected
Type:String
Parameter Sets:Protected, Protecting, NotProtected
Position:Named
Default value:None
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
Parameter Sets:IRPending, ProtectionStopped, ProtectionError, Protected
Position:Named
Default value:None
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
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

AzureRmBackupContainer

Outputs

AzureRmBackupItem