Force Free Tape with GUI in SCDPM

Here is a PowerShell Script which uses the Out-Gridview to build a GUI to force free Tapes in SCDPMYou can easily choose your Library and your Tapes which you want to delete the Recoverypoints on and marks the Tape as free.Script is using the Force-FreeTape.ps1 from Microsoft SCD
4.9 Star
2,118 times
Add to favorites
System Center
E-mail Twitter Digg Facebook
  • Since the program intended to select Library
    1 Posts | Last post December 14, 2018
    • Hi,
      Since my understanding is to select tape library I have included $Library=Get-DPMLibrary | Where-Object {$_.Type -eq "TapeLibrary"} so by doing so only library is being presented. Also included relevant objects to be populated on the second screen selecting the tape (Select-Object -Property Location, CreationDate, TapeBarcode, Label.)
      Thank you very much! NICE WORK!!!
  • Can't make it work on DPM 2012 R2
    1 Posts | Last post May 28, 2018
    • Hello,
      can you please help?
      If I run this on out DPM 2012 R2 Server, which has a standalone LTO-5 drive, the following happens:
      I can select the Library and the tape (there always is just one of each).
      Then it removes all recovery points without an error.
      After removing all recovery points it aborts with:
      "The selected tapes cannot be marked as free because they belong to protection groups.
      You need to stop protection of the associated protection groups before you can mark the tapes as free. The protection group that a tape belongs to is listed in the Protection Group column. (ID: 31116)"
      If I look into DPM, all the recovery points, which were deleted by the script, are still there. A new inventory doesn't Change this.
      If run the script again, it finds and deletes all points again and then fails with the same error.
      What am I doing wrong? 
  • Not a question, rather an addition to the Description
    2 Posts | Last post April 26, 2018
  • Also not a question...
    2 Posts | Last post April 26, 2018
    • This script is fantastic in every way. Works with all versions of DPM (tested with 2010, 2012, and 2016) and it has a GUI so there is no more guessing the tape or slot (which is a pita if you have a standalone drive).
      Thank you very much to the author!!!
    • thanks
  • It won't work if you have a "ghost" library with same userfriendly name.
    2 Posts | Last post February 21, 2017
    • Import-Module DataProtectionManager
      if ($Host.Version.Major -ge $PSPre) {
          } else {
          Write-Host "Wrong PS Version, you are running Version: " $Host.Version.Major
          Write-Host "You need PowerShell V3"
          Write-Host "Download PowerShell V3:"
          Write-Host "Press Key to exit...."
      $Library=Get-DPMLibrary  | Select id,userfriendlyname, DriveCount, SlotCount, ProtectionGroups | Out-GridView -PassThru -Title "Choose Library"
      $Library = Get-DPMLibrary | where {$ -eq $}
      $Slots=Get-DPMTape -DPMLibrary $Library | Out-GridView -PassThru -Title "Choose Tapes" | select Location
      if ($Slots) {
          foreach ($Slot in $Slots) {
              Write-Host "Processing tape on"$Slot.Location -ForegroundColor Green
              ForceFree-Tape.ps1 -DPMServerName $DPMServer -LibraryName $Library.userfriendlyname -TapeLocationList $Slot.Location
          }} else {
              Write-Host "No tape selected" -ForegroundColor Magenta
    • I had to use "Select id" when choosing library.
      I also added some eye candy improvements.