Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a backup server running System Center Data Protection Manager 2012, connected to a couple of tape drives (no library). I also have, of course, some tapes. Tape rotation is manual.

The tape have been used before, by DPM itself (but the server has been completely rebuilt) and by other backup softwares; they are not emtpy. But they contain no data that DPM knows and/or wants to preserve, so they can be marked as free without having to run forcefreetape.ps1.

When a tape is placed into the drive, it is required to perform an inventory, have it recognized as an imported tape and then mark it as free; otherwise DPM will simply refuse to use it.

How can I tell DPM to automatically treat those imported tapes as free? And, of course, I do not want to reuse real backup tapes if by chance they get put into the drives before their expiration date, so the solution should mark imported tapes as free, but should not do the same with real, non-expired tapes.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

As usual, a bit of scripting is needed...

Import-Module DataProtectionManager

$Server = Get-Content env:computername

Get-DPMLibrary $Server | foreach {
    write-host
    write-host Starting inventory for library $_.UserFriendlyName

    $result = Start-DPMLibraryInventory -DPMLibrary $_ -DetailedInventory

    while (!$result.HasCompleted)
    {
        write-host -NoNewline "."
        sleep 1
    }

    write-host
    write-host Inventory complete for library $_.UserFriendlyName

    write-host Setting tape in library $_.UserFriendlyName as free

    Get-DPMTape $_ | Set-DPMTape -Free

    write-host Operation completed for library $_.UserFriendlyName
}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.