This is a sample script that will automatically create new recovery points for the entire Data source’s in a Protection Group. You can customize this easily to change script file to create recovery points on disk. Save the attached file as a .ps1 file and invoke through the DPM Management Shell.
--------------------- Start of Script ---------------------
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..."
}
}
--------------------- End of Script ------------------------
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.