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!!! August
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?
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!!!
Import-Module DataProtectionManager $PSPre="3" if ($Host.Version. Major -ge $PSPre) { } else { Write-Host "Wrong PS Version, you are running Version: " $Host.Version.M ajor Write-Host "You need PowerShell V3" Write-Host "Download PowerShell V3: http://www.micr osoft.com/en-us /download/detai ls.aspx?id=3459 5" Write-Host "Press Key to exit...." $x=$HOST.UI.Raw UI.ReadKey("NoE cho,IncludeKeyD own") exit } $DPMServer=$env :COMPUTERNAME $Library=Get-DP MLibrary | Select id,userfriendly name, DriveCount, SlotCount, ProtectionGroup s | Out-GridView -PassThru -Title "Choose Library" $Library = Get-DPMLibrary | where {$_.id -eq $Library.id} $Slots=$null $Slots=Get-DPMT ape -DPMLibrary $Library | Out-GridView -PassThru -Title "Choose Tapes" | select Location if ($Slots) { foreach ($Slot in $Slots) { Write-Host "Processing tape on"$Slot.Locati on -ForegroundColo r Green ForceFree-Tape. ps1 -DPMServerName $DPMServer -LibraryName $Library.userfr iendlyname -TapeLocationLi st $Slot.Location }} else { Write-Host "No tape selected" -ForegroundColo r Magenta }
I had to use "Select id" when choosing library. I also added some eye candy improvements.