Restore-DPMRecoverableItem

Restores a version of the data source to a target location.

Syntax

Restore-DPMRecoverableItem
       [-RecoveryOption] <RecoveryOptions>
       [[-RecoverableItem] <RecoverableObject[]>]
       [-RecoveryPointLocation <RecoverySourceLocation[]>]
       [-JobStateChangedEventHandler <JobStateChangedEventHandler>]
       [-RecoveryNotification <NotificationObject>]
       [-AdhocJobsContext <AdhocJobsContext>]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]

Description

The Restore-DPMRecoverableItem cmdlet recovers a point in time version of a recoverable item to the target location. A recoverable item is a data source or a child recoverable item in a data source.

Examples

Example 1: Restore a version of a data source to a target location

PS C:\>$PGroup = Get-DPMProtectionGroup -DPMServerName "DPMServer02"
PS C:\> $PObjects = Get-DPMDatasource -ProtectionGroup $PGroup[0]
PS C:\> $RPoint = Get-DPMRecoveryPoint -Datasource $PObjects[0] | Sort -Property RepresentedPointInTime -Descending | Select-Object -First 1
PS C:\> $ROption = New-DPMRecoveryOption -HyperVDatasource -TargetServer "HVDCenter02" -RecoveryLocation AlternateHyperVServer -RecoveryType Recover -TargetLocation "C:\VMRecovery"
PS C:\> Restore-DPMRecoverableItem -RecoverableItem $RPoint -RecoveryOption $ROption

This example restores a version of a nextref_virtualname data source to a recovery location.

The first command gets the protection group on the DPM server named DPMServer02, and then stores it in the $PGroup variable.

The second command gets the list of data sources for the first protection group in the $PGroup array. The command stores the results in the $PObjects variable.

The third command gets the recovery point for the first data source in the $PObjects array, and then passes it to the Sort-Object cmdlet by using the pipe operator. The Sort-Object cmdlet sorts the collection of recovery points in descending order of the date and time value of the RepresentedPointInTime property. The Select-Object cmdlet selects the first recovery point from the collection, and then stores it in the $RPoint variable. For more information, type Get-Help Sort-Object and Get-Help Select-Object.

The fourth command creates a recovery option for a nextref_virtualname data source on the server named HVDCenter02. The command specifies AlternateHyperVServer as the recovery location and specifies that DPM stores the replica of the data source in C:\VMRecovery. The command stores the recovery option in the $ROption variable.

The fifth command restores the data source in $RPoint by using the recovery option in $ROption.

Parameters

-AdhocJobsContext

Specifies the context details of the ad hoc job. Do not use this parameter from the Windows PowerShell command line.

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

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-JobStateChangedEventHandler

Specifies an event handler for Job.StateChanged events. Use this parameter and the Async parameter to build a graphical user interface based on cmdlets. Do not use this parameter in the System Center 2019 - Data Protection Manager (DPM) Management Shell.

Type:JobStateChangedEventHandler
Aliases:Handler
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RecoverableItem

Specifies a recoverable item object. This is a child item in a recovery point that is recoverable. Examples include the following: a file system share or volume, a Microsoft SQL Server database, a Microsoft Exchange Server storage group, Microsoft SharePoint Site, Microsoft Virtual Machine, a Microsoft DPM database, system state or a recovery point.

Type:RecoverableObject[]
Position:2
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-RecoveryNotification

Specifies that the recovery operation send a notification when the recovery operation finishes. The New-NotificationObject cmdlet returns the notification object.

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

-RecoveryOption

Specifies the recovery options for the data source. You can use the New-DPMRecoveryOption cmdlet to create recovery options.

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

-RecoveryPointLocation

Specifies an array of recovery point locations of recovery point that this cmdlet restores. To obtain a recovery point location object, use the Get-DPMRecoveryPointLocation cmdlet. If a recovery item exists in more than one recovery point, you must specify the location of a recovery point.

Type:RecoverySourceLocation[]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False