Skip to content

Instantly share code, notes, and snippets.

Created January 3, 2017 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/87826d9f4b8a2c59412cd968e4e33c80 to your computer and use it in GitHub Desktop.
Save anonymous/87826d9f4b8a2c59412cd968e4e33c80 to your computer and use it in GitHub Desktop.
Restoring a Hyperv Backup in DPM using powershell
$DPMServer = "DPMServer1" ## Enter the DPM Server Name
$Agent_Hostname = "Agent" ## Enter the AGENT Server Hostname
$Protection_GroupName = "Hyper-V" ## Enter the Protection Group Name
$Protection_ObjectName = "Test-DPMBackup" ## Enter the Protection object Name, Files are present inside it that needs to be recovered. If I double click on
it will show NEW VOLUME then D:\Inetpub or something, I need to recover this Inetpub folder only ##
# Task 1 : Selecting the Specific Protection Group
$PGroup = Get-DPMProtectionGroup -DPMServerName $DPMServer
$PGroup = $PGroup | ?{$_.Name -eq $Protection_GroupName }
# Task 2 : Selecting the Specific Protection Object
$PObjects = Get-DPMDatasource -ProtectionGroup $PGroup
$PObjects = $PObjects | ?{$_.Name -eq $Protection_ObjectName}
$RPoint = Get-DPMRecoveryPoint -Datasource $PObjects | Sort -Property RepresentedPointInTime -Descending | Select-Object -First 1
$ROption = New-DPMRecoveryOption -HyperVDataSource -TargetServer $DPMServer -RecoveryLocation CopyToFolder -TargetLocation "C:\BackupTemp\" -RecoveryType restore
Restore-DPMRecoverableItem -RecoverableItem $RPoint -RecoveryOption $ROption
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment