Get-AzRecoveryServicesBackupWorkloadRecoveryConfig
This command constructs the recovery configuration of a backed up item such as SQL DB. The configuration object stores all details such as the recovery mode, target destinations for the restore and application specific parameters like target physical paths for SQL.
Syntax
RpParameterSet (Default)
Get-AzRecoveryServicesBackupWorkloadRecoveryConfig
[[-RecoveryPoint] <RecoveryPointBase>]
[[-TargetItem] <ProtectableItemBase>]
[[-Item] <ItemBase>]
[-OriginalWorkloadRestore]
[-AlternateWorkloadRestore]
[-TargetContainer <ContainerBase>]
[-RestoreAsFiles]
[-FromFull <RecoveryPointBase>]
[-FilePath <String>]
[-VaultId <String>]
[-DefaultProfile <IAzureContextContainer>]
[-UseSecondaryRegion]
[<CommonParameters>]
LogChainParameterSet
Get-AzRecoveryServicesBackupWorkloadRecoveryConfig
[[-PointInTime] <DateTime>]
[[-TargetItem] <ProtectableItemBase>]
[[-Item] <ItemBase>]
[-OriginalWorkloadRestore]
[-AlternateWorkloadRestore]
[-TargetContainer <ContainerBase>]
[-RestoreAsFiles]
[-FromFull <RecoveryPointBase>]
[-FilePath <String>]
[-VaultId <String>]
[-DefaultProfile <IAzureContextContainer>]
[-UseSecondaryRegion]
[<CommonParameters>]
Description
The command returns a recovery config for AzureWorkload items which is passed to the restore cmdlet.
Examples
Example 1
$SQLRecoveryObject = Get-AzRecoveryServicesBackupRecoveryPoint -Item $SQLBkpItem $startdate $enddate | Get-AzRecoveryServicesBackupWorkloadRecoveryConfig -OriginalWorkloadRestore
$SQLRecoveryObject = Get-AzRecoveryServicesBackupRecoveryPoint -Item $SQLBkpItem $startdate $enddate | Get-AzRecoveryServicesBackupWorkloadRecoveryConfig -AlternateWorkloadRestore -TargetItem $SQLProtItem -TargetContainer $targetVMContainer
The first cmdlet is used to get the Recovery point object.
The second cmdlet creates a recovery plan for a original ___location restore.
THe third cmdlet creates a recovery plan for a alternate ___location restore.
Note: Parameter -TargetContainer is mandatory in case of AlternateLocationRestore or RestoreAsFiles.
Example 2
This command constructs the recovery configuration of a backed up item such as SQL DB. (autogenerated)
Get-AzRecoveryServicesBackupWorkloadRecoveryConfig -AlternateWorkloadRestore -RecoveryPoint $rp[0] -TargetItem <ProtectableItemBase> -TargetContainer $targetVMContainer -VaultId $vault.ID
Parameters
-AlternateWorkloadRestore
Specifies that the backed up DB should be restored onto another selected server.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-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
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-FilePath
Specifies the filepath which is used for restore operation.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-FromFull
Specifies the Full RecoveryPoint to which Log backups will be applied.
Parameter properties
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Item
Specifies the backup item on which the restore operation is being performed.
Parameter properties
Type: ItemBase
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: 2
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-OriginalWorkloadRestore
Specifies that the backed up DB is to be overwritten with the DB information present in the recovery point.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-PointInTime
End time of Time range for which recovery point need to be fetched
Parameter properties
Type: DateTime
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
LogChainParameterSet
Position: 0
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-RecoveryPoint
Recovery point object to be restored
Parameter properties
Parameter sets
RpParameterSet
Position: 0
Mandatory: False
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-RestoreAsFiles
Specifies to restore Database as files in a machine.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-TargetContainer
Specifies the target machine on which DB Files need to be restored. TargetContainer is mandatory in case of AlternateLocationRestore or RestoreAsFiles.
Parameter properties
Type: ContainerBase
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-TargetItem
Specifies the target on which the DB needs to be restored. For SQL restores, it needs to be of protectable item type SQLInstance only.
Parameter properties
Parameter sets
(All)
Position: 1
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-UseSecondaryRegion
Filters from Secondary Region for Cross Region Restore
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-VaultId
ARM ID of the Recovery Services Vault.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
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 .
Outputs