DPM Powershell Script to Mark tape in Tape drive as free

2017-12-04T14:46:38+00:00 April 9th, 2010|PowerShell|

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