通过PowerShell脚本从DPM2010恢复虚拟机

我需要通过PowerShell恢复由DPM 2010覆盖的VM。 我用谷歌search,这是一种痛苦find没有关于DPM和Powershell的有用的文档。

参数: – 虚拟机正在群集共享卷上运行Server 2003上的Server 2005 R2 64位节点 – 两个节点上都安装了DPM 2010服务器代理 – 虚拟机的还原在DPM GUI

我想要什么? – 每天将最新的虚拟机恢复到networking位置

我的脚本的当前状态:

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

它能做什么:

 $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! 

现在我不知道如何继续。 我想获得最新的恢复项目,并希望将其恢复到networking上任何位置的networking共享。

我该怎么做呢?

谢谢!!

托比

当前工作脚本:

 #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 }