none
get-datasource properties RRS feed

  • Question

  • This might need to go to the scorch group but I'll ask it here first. i'm working on a scorch workflow that automatically adds a VM to DPM once it is created. I can not find good documentation on what I need to fill out in order to get the data source. Once I get the data source I can back it up.

    I'm assuming the first option has to be production server because my only other choice is protection group, which the data source is not a part of yet? 

    I'm confused on the name because no matter what I put in I get errors saying DPM could find it. I'm assuming that is the name of the hyper-v guest I'm trying to backup?

    i used this powershell: Get-DPMDatasource | ? {$_.ObjectType -eq "Microsoft Hyper-V"} 

    Then I found a test server listed that is not normally backed up. but I've tried using its name as it appears in DPM "Online\Test-Server"

    any insight or a real guide would be great. Thanks

    Saturday, January 23, 2016 4:25 AM

Answers

  • Hi!

    You can use this script with "Initialize Data" parameters (variable in the script):

     
      $PGNAME = "Your Protection Group Name"
      $DPMServer = "Your DPM Server Name"
      $HyperVHost = "Your Hyper-V Server Name"
      $Client = "Your NOTProtected Server Name"
      
        
      $pg = Get-DPMProtectionGroup -DPMServerName $DPMServer | Where-Object {$_.FriendlyName.ToUpper() -eq $PGNAME.ToUpper()}
      $Modpg = Get-DPMModifiableProtectionGroup -ProtectionGroup $pg
      
      # Gets computers on which the DPM protection agent is installed.
      $ps = Get-DPMProductionServer -DPMServername $DPMServer | where { $_.Servername -contains $HyperVHost }
      
      # Gets protected and unprotected data in a computer or protection group
      $ds = Get-DPMDataSource -ProductionServer $ps | Where  {$_.Name -match "$Client"} 
      
      # Adds a data source or a child data source to a protection group
      # if you have massive of $ds that use index for example, $ds[0]
      Add-DPMChildDataSource -ProtectionGroup $Modpg -ChildDataSource $ds
      
      # Sets the protection type for a protection group 
      Set-DPMProtectionType -ProtectionGroup $Modpg -ShortTerm Disk
    
      # Sets the replica creation method for disk-based protection
      Set-DPMReplicaCreationMethod -ProtectionGroup $Modpg -Manual
    
      # Saves all the actions performed on the protection group on the DPM server
      Set-DPMProtectionGroup $Modpg
    
      

      

    you can run remotely or copy to server DPM and run localy

    Also read  Run DPM PowerShell Script and Get Data Source.

    TechNet repository: Add Datasource to SCDPM with Powershell


    Have a nice day !!!
    DPM 2012 R2: Remove Recovery Points
    DPM blog
    System Center
    Hyper-V






    Monday, August 15, 2016 7:30 AM
    Moderator

All replies

  • Hi,

    The following article describes the process to automatically add VMs to a protection group:

    Optimize virtual machine protection

    Hope it helps!

    Kind Regards
    Markus Eliasson

    Monday, January 25, 2016 8:49 AM
  • Hi!

    You can use this script with "Initialize Data" parameters (variable in the script):

     
      $PGNAME = "Your Protection Group Name"
      $DPMServer = "Your DPM Server Name"
      $HyperVHost = "Your Hyper-V Server Name"
      $Client = "Your NOTProtected Server Name"
      
        
      $pg = Get-DPMProtectionGroup -DPMServerName $DPMServer | Where-Object {$_.FriendlyName.ToUpper() -eq $PGNAME.ToUpper()}
      $Modpg = Get-DPMModifiableProtectionGroup -ProtectionGroup $pg
      
      # Gets computers on which the DPM protection agent is installed.
      $ps = Get-DPMProductionServer -DPMServername $DPMServer | where { $_.Servername -contains $HyperVHost }
      
      # Gets protected and unprotected data in a computer or protection group
      $ds = Get-DPMDataSource -ProductionServer $ps | Where  {$_.Name -match "$Client"} 
      
      # Adds a data source or a child data source to a protection group
      # if you have massive of $ds that use index for example, $ds[0]
      Add-DPMChildDataSource -ProtectionGroup $Modpg -ChildDataSource $ds
      
      # Sets the protection type for a protection group 
      Set-DPMProtectionType -ProtectionGroup $Modpg -ShortTerm Disk
    
      # Sets the replica creation method for disk-based protection
      Set-DPMReplicaCreationMethod -ProtectionGroup $Modpg -Manual
    
      # Saves all the actions performed on the protection group on the DPM server
      Set-DPMProtectionGroup $Modpg
    
      

      

    you can run remotely or copy to server DPM and run localy

    Also read  Run DPM PowerShell Script and Get Data Source.

    TechNet repository: Add Datasource to SCDPM with Powershell


    Have a nice day !!!
    DPM 2012 R2: Remove Recovery Points
    DPM blog
    System Center
    Hyper-V






    Monday, August 15, 2016 7:30 AM
    Moderator