This script automatically adds all unprotected SQL databases in all instances for protection. You can customize this easily to suit your needs. For example, you could change the protection policy.
Save the following script as a .ps1 file and start it through the DPM Management Shell. You can use Windows Scheduler and schedule the script to run at specific times.

Important: The script will add all databases including ones that may have been excluded earlier.

This script was contributed by the System Center Data Protection Manager (DPM) team.

Visual Basic
Edit|Remove

param([string] $ProductionServer, [string] $PGName)
if(!$ProductionServer)
{
$ProductionServer = read-host "Enter the production server name : "
}
if(!$PGName)
{
$PGName = read-host "Enter the name of your existing SQL protection group name : "
}

$dpmservername = &"hostname"
connect-dpmserver $dpmservername
$dpmservername

$PGList = @(Get-ProtectionGroup $dpmservername)

foreach ($PG in $PGList)
{
if($PG.FriendlyName -eq $PGName)
{
write-host "Found PG $PGName"
$MPG = Get-ModifiableProtectionGroup $PG
$PGFound=$true
}
}

if(!$PGfound)
{
write-host "Protection Group $PGName does not exist"
exit 1
}

$PSList=@(Get-ProductionServer $dpmservername)
$DsList = @()

foreach ($PS in $PSList)
{
if($PS.NetBiosName -eq $ProductionServer)
{
write-host "Running Inquiry on" $PS.NetbiosName
$DSlist += Get-Datasource -ProductionServer $PS -Inquire
$PSFound=$true
}
}

if(!$PSfound)
{
"Production Server $PS does not exist"
exit 1
}

$protectedDsList = @()
foreach ($ds in $dslist)
{
if($ds.ToString("T", $null) -match "SQL" -and !$ds.Protected)
{
write-host "Adding to your SQL protection PG" $ds.Name
$protectedDsList += $ds
Add-ChildDatasource -ProtectionGroup $MPG -ChildDatasource $ds
}
}

foreach ($ds in $protectedDsList)
{
$x=Get-DatasourceDiskAllocation -Datasource $ds
Set-DatasourceDiskAllocation -Datasource $x -ProtectionGroup $MPG

}

Set-ReplicaCreationMethod -ProtectionGroup $MPG -Now

if($protectedDsList.Length)
{
write-host "Adding new SQL DBs to" $MPG.FriendlyName
Set-protectiongroup $MPG
}

disconnect-dpmserver $dpmservername
"Exiting from script"