Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
Get-AzRecoveryServicesBackupItem
- Module:
- Az.RecoveryServices Module
Gets the items from a container in Backup.
Syntax
GetItemsForContainer (Default)
Get-AzRecoveryServicesBackupItem
[-Container] <ContainerBase>
[[-Name] <String>]
[[-ProtectionStatus] <ItemProtectionStatus>]
[[-ProtectionState] <ItemProtectionState>]
[-WorkloadType] <WorkloadType>
[[-DeleteState] <ItemDeleteState>]
[-FriendlyName <String>]
[-VaultId <String>]
[-DefaultProfile <IAzureContextContainer>]
[-UseSecondaryRegion]
[<CommonParameters>]
GetItemsForVault
Get-AzRecoveryServicesBackupItem
[-BackupManagementType] <BackupManagementType>
[[-Name] <String>]
[[-ProtectionStatus] <ItemProtectionStatus>]
[[-ProtectionState] <ItemProtectionState>]
[-WorkloadType] <WorkloadType>
[[-DeleteState] <ItemDeleteState>]
[-FriendlyName <String>]
[-VaultId <String>]
[-DefaultProfile <IAzureContextContainer>]
[-UseSecondaryRegion]
[<CommonParameters>]
GetItemsForPolicy
Get-AzRecoveryServicesBackupItem
[-Policy] <PolicyBase>
[[-Name] <String>]
[[-ProtectionStatus] <ItemProtectionStatus>]
[[-ProtectionState] <ItemProtectionState>]
[[-DeleteState] <ItemDeleteState>]
[-FriendlyName <String>]
[-VaultId <String>]
[-DefaultProfile <IAzureContextContainer>]
[-UseSecondaryRegion]
[<CommonParameters>]
Description
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.
Examples
Example 1: Get an item from a Backup container
$vault = Get-AzRecoveryServicesVault -ResourceGroupName "resourceGroup" -Name "vaultName"
$Container = Get-AzRecoveryServicesBackupContainer -ContainerType AzureVM -FriendlyName "V2VM" -VaultId $vault.ID
$BackupItem = Get-AzRecoveryServicesBackupItem -Container $Container -WorkloadType AzureVM -VaultId $vault.ID
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
$vault = Get-AzRecoveryServicesVault -ResourceGroupName "resourceGroup" -Name "vaultName"
$Container = Get-AzRecoveryServicesBackupContainer -ContainerType AzureStorage -FriendlyName "StorageAccount1" -VaultId $vault.ID
$BackupItem = Get-AzRecoveryServicesBackupItem -Container $Container -WorkloadType AzureFiles -VaultId $vault.ID -FriendlyName "FileShareName"
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
$vault = Get-AzRecoveryServicesVault -ResourceGroupName "resourceGroup" -Name "vaultName"
$Container = Get-AzRecoveryServicesBackupContainer -ContainerType AzureStorage -FriendlyName "StorageAccount1" -VaultId $vault.ID
$softDeletedItems = Get-AzRecoveryServicesBackupItem -Container $Container -WorkloadType AzureFiles -VaultId $vault.ID -DeleteState SoftDeleted
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.
Parameters
-BackupManagementType
The class of resources being protected. The acceptable values for this parameter are:
- AzureVM
- MAB
- AzureStorage
- AzureWorkload
Parameter properties
| Type: | BackupManagementType |
| Default value: | None |
| Accepted values: | AzureVM, MAB, AzureStorage, AzureWorkload |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-Container
Specifies a container object from which this cmdlet gets backup items. To obtain an AzureRmRecoveryServicesBackupContainer, use the Get-AzRecoveryServicesBackupContainer cmdlet.
Parameter properties
| Type: | ContainerBase |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with azure.
Parameter properties
| Type: | IAzureContextContainer |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
Parameter sets
-DeleteState
Specifies the deletestate of the item The acceptable values for this parameter are:
- ToBeDeleted
- NotDeleted
Parameter properties
| Type: | ItemDeleteState |
| Default value: | None |
| Accepted values: | ToBeDeleted, NotDeleted |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-FriendlyName
FriendlyName of the backed up item
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-Name
Specifies the name of backup item. For file share, specify the unique ID of protected file share.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-Policy
Protection policy object.
Parameter properties
| Type: | PolicyBase |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-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.
Parameter properties
| Type: | ItemProtectionState |
| Default value: | None |
| Accepted values: | IRPending, ProtectionError, Protected, ProtectionStopped, BackupsSuspended |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-ProtectionStatus
Specifies the overall protection status of an item in the container. The acceptable values for this parameter are:
- Healthy
- Unhealthy
Parameter properties
| Type: | ItemProtectionStatus |
| Default value: | None |
| Accepted values: | Healthy, Unhealthy |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-UseSecondaryRegion
Filters from Secondary Region for Cross Region Restore
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-VaultId
ARM ID of the Recovery Services Vault.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-WorkloadType
Workload type of the resource. The acceptable values for this parameter are:
- AzureVM
- AzureFiles
- MSSQL
- FileFolder
- SAPHanaDatabase
Parameter properties
| Type: | WorkloadType |
| Default value: | None |
| Accepted values: | AzureVM, AzureFiles, MSSQL, FileFolder, SAPHanaDatabase |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
CommonParameters
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.
Inputs
ContainerBase
String
Outputs
ItemBase
Related Links
Azure PowerShell
Feedback
Was this page helpful?
