none
DPM Script to Recover a Folder in a Volume RRS feed

  • Question

  • I'm trying to eventually create a script to automate the recovery of a test file from all backed up servers but am first attempting to even perform a recovery using powershell. This is what I have presently:

    # Ensures DPM Snapin module is enabled
    Import-Module DataProtectionManager
    
    #Gets protection group on DPM server DPM01 and stores in $PGroup Variable
    $PGroup = Get-DPMProtectionGroup -DPMServerName "DPM01"
    
    #Gets list of data sources for the specified protection group in $PGroup, stores in $PObjects
    $PObjects = Get-DPMDatasource -ProtectionGroup $PGroup[1] | Sort-Object -Property Name
    
    #Gets first recovery point for first data source in $PObjects array. Stores in $RPoint
    $RPoint = Get-DPMRecoveryPoint -Datasource $PObjects[0] | Sort -Property RepresentedPointInTime -Descending | Select-Object -First 1
    
    
    #Creates recovery option for hyper-v data source on server named DPM01 (need to change this to import a list of the servers). Specefies recovery location and file path. Stores this in $Roption
    $ROption = New-DPMRecoveryOption -DPMServerName "DPM01" -HyperVDatasource -TargetServer "DPM01" -RecoveryLocation CopyToFolder -RecoveryType recover  -TargetLocation "\\DPM01.mydomain.com\c$\testrecovery"
    
    
    #Performs data source in $Rpoint by using recovery option specified in $Roption
    Restore-DPMRecoverableItem -RecoverableItem $RPoint -RecoveryOption $ROption
    

    When I get to the 5th command I always run into the error unless I set the -recoverylocation parameter to AlternateHyperVServer:

    New-DPMRecoveryOption : The recovery point location that you have passed is invalid. Please try again with a different value. (ID: 31050)
    At line:1 char:12
    + $ROption = New-DPMRecoveryOption -DPMServerName "DPM01" -HyperVDatasour ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [New-DPMRecoveryOption], DlsException
        + FullyQualifiedErrorId : InvalidRecoveryLocation,Microsoft.Internal.EnterpriseStorage.Dls.Cmdlets.NewDPMRecoveryOption
    New-DPMRecoveryOption : The recovery point location that you have passed is invalid. Please try again with a different value. (ID: 31050)
    At line:1 char:12
    + $ROption = New-DPMRecoveryOption -DPMServerName "DPM01" -HyperVDatasour ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [New-DPMRecoveryOption], DlsException
        + FullyQualifiedErrorId : InvalidRecoveryLocation,Microsoft.Internal.EnterpriseStorage.Dls.Cmdlets.NewDPMRecoveryOption

    When I do set it to AlternateHyperVServer it successfully stores the recovery option but when I go to run the last command to execute the recovery I always run into this error:

    Restore-DPMRecoverableItem : Cannot bind parameter 'RecoverableItem'. Cannot convert the "Microsoft.Internal.EnterpriseStorage.Dls.UI.ObjectModel.SQL.SQLRecoverysource" value of type 
    "Microsoft.Internal.EnterpriseStorage.Dls.UI.ObjectModel.SQL.SQLRecoverysource" to type "Microsoft.Internal.EnterpriseStorage.Dls.UI.ObjectModel.OMCommon.RecoverableObject".
    At line:1 char:45
    + Restore-DPMRecoverableItem -RecoverableItem $RPoint -RecoveryOption $ROption
    +                                             ~~~~~~~
        + CategoryInfo          : InvalidArgument: (:) [Restore-DPMRecoverableItem], ParameterBindingException
        + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.Internal.EnterpriseStorage.Dls.Cmdlets.RecoverDPMRecoverableItem
    

    Quite frustrating as all the technet articles and everything else I have looked at has not been so useful to me. I have 130+ servers I am required to do test restores of any file of my choosing and I would rather not have to do this manually for each...

    Wednesday, November 15, 2017 3:30 PM