Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to restore a VM covered by DPM 2010 via powershell. I searched with google and it is kind of painfull to find no usefull documentation about DPM and Powershell.

Parameters: - VMs are running on Cluster Shared Volumes with Server 2005 R2 on Server 2003 64 bit Nodes - DPM 2010 Server Agent is installed on both nodes - restoration of VMs works fine with DPM GUI

What do I want? - daily restore latest virtual machines to network place

Current status of my script:

$pg = get-protectiongroup -dpmservername DPM2010
$ds = get-datasource -protectiongroup $pg
$rp = get-recoverypoint -datasource $ds[0]

What it does:

$pg shows me the Protection Groups, ok.
$ds shows me all virtual machines from the Recovery Group, nice.
$rp shows me all recovery points of the Virtual Machine from line 0, awesome!

Now I don't know how to go ahead. I want to get the latest Recovery Item and want to restore it to a network share anywhere on the network.

How do I have to do that?



share|improve this question
up vote 0 down vote accepted

Current working Script:

#set target location
$targetserver  = "FQDN of Server"
$targetlocation = "drive letter with :\"

#get protectiongroup name
$pg = get-protectiongroup -dpmservername DPMServerName

#get all Virtual Machines from recovery group
$ds = get-datasource -protectiongroup $pg

#how many VMs do we have?
$an = $ds.count

#as long as: a is null, run as long as a is < 9 and a+1
For ($a = 0; $a -lt $an; $a++)
  $rp = get-recoverypoint -datasource $ds[$a] | sort -Property RepresentedPointInTime -Descending | select -First 1
  $Rop = New-RecoveryOption -GenericDatasource -TargetServer $targetserver -RecoveryLocation CopyToFolder -RecoveryType Restore -TargetLocation $targetlocation
  Recover-RecoverableItem -RecoverableItem $Rp -RecoveryOption $rop
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.