How to Add an specific folder to DPM protection group RRS feed

  • Question

  • Hello Experts,

    Good Day !

    I would like to know how to add an specific folder (ex D:\Sample\DPM) to the my protection group using powershell .


    Friday, January 18, 2019 8:35 AM

All replies

  • You can use the cmdlet New-Item to do the same.

    New-item  D:\Sample\DPM -ItemType directory
    This will create directory in D:\Sample

    Friday, January 18, 2019 9:51 AM
  • Hello!

    Here's how you can do it, I will give you an example below:

    This is my protected server (DC01) and I want to protect the Recovery folder.

    And this is how my protection group looks like now:

    On the DPM server open up a PowerShell / DPM Shell.

    Here's the whole script that I will use:

    Import-Module DataProtectionManager
    $PG = Get-DPMProtectionGroup -DPMServerName "DPM" | Where-Object {$_.FriendlyName.ToUpper() -eq "Protection Group 1"} 
    $PS = Get-DPMProductionServer -DPMServerName "DPM" | where {$_.Servername -eq "DC01" }
    $DS = Get-DPMDatasource -ProductionServer $PS -Inquire | where {$ -eq "C:\"}
    $PO = Get-DPMChildDatasource -ChildDatasource $DS -Inquire 
    $MPG = Get-DPMModifiableProtectionGroup $PG 
    Add-DPMChildDatasource -ProtectionGroup $MPG -ChildDatasource $PO.Item(6)
    Set-DPMProtectionGroup -ProtectionGroup $MPG 

    I will show a step-by-step with screenshots:

    Now I will have to count to know which index number in the array above the folder has that I want to protect, I wanted to protect the Recovery folder, so it will be number 6 in the array (the numbering always starts from 0, 1, 2, 3....).

    We can double check that the array index is correct as follows:

    Next up we add the folder to the protection group:

    We should now see the added folder in the protection group in the DPM console.

    Best regards,

    Blog: LinkedIn:

    • Proposed as answer by Leon Laude Monday, January 21, 2019 1:25 AM
    Friday, January 18, 2019 10:12 AM
  • Hello!

    Just checking in to see if my previous replies were of any help.

    (Please don't forget to mark as answer)

    Blog: LinkedIn:

    Friday, February 15, 2019 9:12 AM