DPM Powershell Script to Mark tape in Tape drive as free
Just a quick powershell script to make your tape drive be marked as free. If you save the below into notepad and save it as a PS1 file then run from DPM management shell this should work with no errors
$LIB = Get-DPMLibrary –DPMServerName servername
$Tape1 = Get-Tape -DPMLibrary $LIB
$Tape2 = Get-RecoveryPoint -Tape $Tape1
foreach ($rp in $Tape2)
{
Get-RecoveryPoint -Datasource $rp.Datasource | out-null
Write-host "Removing recovery point $($rp.RepresentedPointInTime) from tape"
Remove-RecoveryPoint -RecoveryPoint $rp -ForceDeletion -Confirm:$false
}
Set-Tape -Tape $Tape1 –Free
Write-Host "This Tape is now free"
You will then see the Tape in the drive marked as Free in the DPM Console
Daniel Davies