02 November 2012

Change retention range for all protections groups in DPM 2012

Let’s assume, you have installed your DPM server, created a bunch of protection groups and everything runs smoothly. By default a protection group holds backups for 5 days. To get the information about your protections groups, use this command:

Get-ProtectionGroup -DPMServerName yourdpmservername | ft FriendlyName,OnsiteRecoveryRange -a

The result looks like this:

image

First you need to open protection group for writing:

Get-ProtectionGroup -DPMServerName yourdpmservername | Get-ModifiableProtectionGroup

To change the retention range to 10 days, use this command:

Get-ProtectionGroup -DPMServerName yourdpmservername | Set-PolicyObjective -RetentionRangeDays 10 -BeforeRecoveryPoint

This command doesn’t give any output and runs very fast.

To write changes, use this command:

Get-ProtectionGroup -DPMServerName yourdpmservername | Set-ProtectionGroup

After change you can confirm the result with the first command introduced in this article.

1 comment:

  1. This script or DPM Server itself has a bug in it. It will reset the backup time to 18:00 Everyday. To reset 18:00 to another time, us this workaround script in a separate DPM Shell window after the change mentioned in the mail article:

    Get-ProtectionGroup -DPMServerName yourdpmservername | Get-ModifiableProtectionGroup
    Get-ProtectionGroup -DPMServerName yourdpmservername | foreach {
    $ShadowCopysch = Get-PolicySchedule $_ -ShortTerm
    Set-PolicySchedule $_ $ShadowCopysch -TimesOfDay 02:00 -DaysOfWeek su,mo,tu,we,th,fr,sa
    Set-ProtectionGroup $_
    }

    ReplyDelete