This script solves error number ID 31224 "Create protection group: <protection group name> failed. The ‘Allocate Replica’ task for <data source name> failed" in semi-automatic mode (with confirm).

The following Powershell script can be used to remove recovery points for the data source we want to change or migrate. This script removes all recovery points for the selected data source that are older than the newest replica ("current") creation time. As a result the oldest replica ("previuos") will be automatically deleted.

Original: Ruud Baars [MSFT] (




Verified on the following platforms:



Addintional links

Also the article (in Russian): 

System Center 2012 R2 Data Protection Manager – решение ошибки ID 31224

Translate (in English): 

The System Center 2012 R2 Data Protection Manager - a decision error ID 31224


Other DPM scripts:


DPM 2012 R2: Remove Recovery Points

DPM 2012 R2: Remove All Recovery Points after Days

DPM 2012 R2: Find Recovery Points (HTML Report at e-mail)

DPM 2012 R2: Find Latested Recovery Point Status (HTML Report at e-mail)