Automatically creates new recovery points for all the data sources in a protection group. This example creates the recovery point to tape, although it can be easily customized to create recovery points on disk. To run, save the attached file as a .ps1 file
and invoke through the DPM Management Shell.
This script was contributed by the System Center Data Protection Manager (DPM) team.
param([string] $dpmname, [string] $pgname, [string] $backupoption) if(!$dpmname) { $dpmname = read-host "DPMName:" } if(!$pgname) { $pgname = read-host "pgName:" } if(!$backupoption) { $backupoption = read-host "BackOption:" } write-Output "Creating $backupoption Recovery Point" trap{"Error in execution... $_";break} &{ write-Output "Getting protection group $pgname in $dpmname..." $clipg = Get-ProtectionGroup $dpmname | where { $_.FriendlyName -eq $pgname} if($clipg -eq $abc) { Throw "No PG found" } write-Output "Getting DS from PG $pgname..." $backupds = @(Get-Datasource $clipg) foreach ($ds in $backupds) { write-Output "Creating Recovery point for $ds..." $j = New-RecoveryPoint -Datasource $ds -Tape -ProtectionType $backupoption $jobtype = $j.jobtype Write-Output "$jobtype Job has been triggerred..." } }
param([string] $dpmname, [string] $pgname, [string] $backupoption) if(!$dpmname) { $dpmname = read-host "DPMName:" } if(!$pgname) { $pgname = read-host "pgName:" } if(!$backupoption) { $backupoption = read-host "BackOption:" } write-Output "Creating $backupoption Recovery Point" trap{"Error in execution... $_";break} &{ write-Output "Getting protection group $pgname in $dpmname..." $clipg = Get-ProtectionGroup $dpmname | where { $_.FriendlyName -eq $pgname} if($clipg -eq $abc) { Throw "No PG found" } write-Output "Getting DS from PG $pgname..." $backupds = @(Get-Datasource $clipg) foreach ($ds in $backupds) { write-Output "Creating Recovery point for $ds..." $j = New-RecoveryPoint -Datasource $ds -Tape -ProtectionType $backupoption $jobtype = $j.jobtype Write-Output "$jobtype Job has been triggerred..." } }