Restore a SystemState using DPM PowerShell RRS feed

  • Question

  • hi

    I need some help.  I protect a server using the BMR function in DPM 2010.  I want to restore the lastest protected data from the PG every night to a share on the network as part of an off site DR solution.  I have written scripts to do this with Volume object types and SQL etc but i can't get the BMR or systemstate to work I'm assuming the object type name is 'file system'.  Does anyone have a working script to restore a system state protection data source?  Here is an example i found but can't get it to work:

    $pgList = Get-ProtectionGroup -dpmServerName Livdpm01 | where {$_.FriendlyName -match "forefrontBareMetal"}

    $DSList = @()
    ForEach ($pg in $pgList)
     $DSList += @(Get-Datasource -protectionGroup $pg)

    ForEach ($DS in $DSList)
     #Get the latest recovery point.
     $recoveryPoints = @(Get-RecoveryPoint -datasource $DS | sort -property RepresentedPointInTime -Descending)
        if ($recoveryPoints.Length -eq 0)
            Write-Host "No recovery point available for" $DS.Name -ForeGroundColor Yellow
        $latestRecoveryPoint = $recoveryPoints[0]
        $RecoverableItem = Get-RecoverableItem -RecoverableItem $latestRecoveryPoint -BrowseType child | where { $_.UserFriendlyName -eq "Bare Metal Recovery" }
        $rop = New-RecoveryOption -targetServer $targetServerName -recoveryLocation CopyToFolder -SystemProtectionDataSource -TargetLocation $restorePath -RecoveryType Restore
        Recover-RecoverableItem $RecoverableItem -recoveryoption $rop

    • Moved by MarcReynolds Wednesday, March 2, 2011 1:08 PM (From:Data Protection Manager)
    Wednesday, March 2, 2011 1:00 PM


  • I changed the  $_.UserFriendlyName -eq "Bare Metal Recovery" } to  $_.UserFriendlyName -eq "system state" } and it now works.  Probebly due to the fact that my protection group is c: and SystemState and not a BMR LOL.  I'm going to change the protection of the PG to a BMR and test the script again.  although it does work as is, there are errors being returned:


    Recover-RecoverableItem : Cannot validate argument on parameter 'RecoverableIte
    m'. The argument is null. Supply a non-null argument and try the command again.
    At C:\users\JoeBloggs\desktop\recoversystem.ps1:23 char:28
    +     Recover-RecoverableItem <<<<  $RecoverableItem -recoveryoption $rop
        + CategoryInfo          : InvalidData: (:) [Recover-RecoverableItem], Para
        + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.Inter

    JobCategory                Status                     HasCompleted
    -----------                ------                     ------------
    RestoreAsFilesFromSC       InProgress                 False

    Wednesday, March 2, 2011 2:13 PM