Share via


Restore-DPMRecoverableItem

Restore-DPMRecoverableItem

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

Syntax

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

Detailed 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.

Parameters

-AdhocJobsContext<AdhocJobsContext>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-JobStateChangedEventHandler<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 DPM Management Shell.

Aliases

Handler

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RecoverableItem<RecoverableObject[]>

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.

Aliases

none

Required?

false

Position?

2

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-RecoveryNotification<NotificationObject]>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RecoveryOption<RecoveryOptions>

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

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-RecoveryPointLocation<RecoverySourceLocation[]>

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.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

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

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

Examples

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

This example restores a version of a Hyper-V 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 Hyper-V 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.

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

Get-DPMDatasource

Get-DPMProtectionGroup

Get-DPMRecoverableItem

Get-DPMRecoveryPoint

Get-DPMRecoveryPointLocation

New-DPMRecoveryOption

New-DPMRecoveryNotification