none
DPM 2012 R2 - Scripting adding/Removing clients from PG's RRS feed

  • Question

  • Hi All

    I've been working my way through the DPM Cmdlet info and am trying to automate adding/removing laptops from PG's. I'm struggling around the ChildDatasource side of it, where it doesn't seem to work for laptops although it's probably me!

    So far I'm failing at simply getting a ChildDatasource:

    $PGs=Get-DPMProtectionGroup -DPMServerName ourdpmserver

    $Ds=Get-Datasource -ProtectionGroup $PGs[1]

    Get-DPMChildDatasource -ChildDatasource $Ds[0] -inquire

    I get:

    Get-DPMChildDatasource : The option NO_PARAM is not supported for client computers. (ID: 7004)
    To specify the folders that need to be backed up, use NO_PARAM. For more details, run get-help NO_PARAM.
    At line:1 char:1
    + Get-DPMChildDatasource -ChildDatasource $Ds[0] -Inquire
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Get-DPMChildDatasource], DlsException
        + FullyQualifiedErrorId : ChildInquiryNotSupportedForClientDS,Microsoft.Internal.EnterpriseStorage.Dls.UI.Cmdlet.ProtectionCmdLets.GetProtectableObject


    Also, for adding laptops to protection groups the example shows:

    $Pg = Get-ProtectionGroup -DPMServerName "DPMServer07"
    $Mpg = Get-ModifiableProtectionGroup $Pg[0]
    $Po = Get-Datasource -ProductionServer "ProductionServer22"
    Add-DPMChildDatasource -ProtectionGroup $Mpg -ChildDatasource $Po[8] 

    But I'm not getting the logic, from this example it shows getting the PG opening it in a modifiable state then I get confused, I want to add a brand new laptop that doesn't exist in DPM yet and have it inherit the config of the PG. not add something that already exists and is covered. 

    My end game is to have a PowerShell script that for our Helpdesk to be able use that requests they enter the name of a new laptop or indeed a list and then have it add those laptops to the desired PG. I've done plenty of PowerShell like it but not in DPM.

    Can anyone put me out of my misery and explain it properly? This side of DPM seems to be pretty badly documented on the key concept side of it.

    Friday, October 9, 2015 2:53 AM

Answers

  • Hi, Malco

    1) You must install agent with

    • DPM console
    • OR Powershell script

    2) Add to group

    try the following

    $PGNAME = "<Your PG Name>"
      $DPMServer = "<Your DPM Server Name>"
      $Client = "<The Client Computer Name>"
      
      $pg = Get-ProtectionGroup -DPMServerName $DPMServer | Where-Object {$_.FriendlyName.ToUpper() -eq $PGNAME.ToUpper()}
      $Modpg = Get-ModifiableProtectionGroup -ProtectionGroup $pg
      $ds = Get-DataSource -ComputerNames $Client -DPMServerName $DPMServer
      Add-ChildDataSource -ProtectionGroup $Modpg -ChildDataSource $ds
      Set-ProtectionGroup -ProtectionGroup $Modpg

    Have a nice day !!!
    DPM 2012 R2: Remove Recovery Points
    DPM blog

    • Proposed as answer by Anton MasyanMVP Friday, October 9, 2015 9:26 AM
    • Marked as answer by [Malco] Sunday, October 11, 2015 10:21 PM
    Friday, October 9, 2015 9:18 AM
    Moderator

All replies

  • Hi, Malco

    1) You must install agent with

    • DPM console
    • OR Powershell script

    2) Add to group

    try the following

    $PGNAME = "<Your PG Name>"
      $DPMServer = "<Your DPM Server Name>"
      $Client = "<The Client Computer Name>"
      
      $pg = Get-ProtectionGroup -DPMServerName $DPMServer | Where-Object {$_.FriendlyName.ToUpper() -eq $PGNAME.ToUpper()}
      $Modpg = Get-ModifiableProtectionGroup -ProtectionGroup $pg
      $ds = Get-DataSource -ComputerNames $Client -DPMServerName $DPMServer
      Add-ChildDataSource -ProtectionGroup $Modpg -ChildDataSource $ds
      Set-ProtectionGroup -ProtectionGroup $Modpg

    Have a nice day !!!
    DPM 2012 R2: Remove Recovery Points
    DPM blog

    • Proposed as answer by Anton MasyanMVP Friday, October 9, 2015 9:26 AM
    • Marked as answer by [Malco] Sunday, October 11, 2015 10:21 PM
    Friday, October 9, 2015 9:18 AM
    Moderator
  • Thanks Eugene, that works perfectly!
    Sunday, October 11, 2015 10:22 PM