I have a lot of tapes and multiple libraries. I recently had a few failures, and wanted to check how many times each tape has been loaded and either read or written too to see if there is a trend with the oldest ones.
I created a little script to do this, and figured I’d sort it from the most loads at the top. It ended up being a coincidence and I have plenty of life left in all my tapes, but always fun to lean a new command
# Load Veeam PowerShell SnapIn if not already loaded
if ((Get-PSSnapin -Name VeeamPSSnapIn -ErrorAction SilentlyContinue) -eq $null) {
Add-PSSnapin VeeamPSSnapIn
}
# Get all tape media
$tapes = Get-VBRTapeMedium
# Create an array to hold the results
$results = @()
foreach ($tape in $tapes) {
$tapeInfo = "" | Select-Object 'TapeName', 'LoadCount'
$tapeInfo.TapeName = $tape.Name
$tapeInfo.LoadCount = $tape.LoadCount
$results += $tapeInfo
}
$results | Sort-Object LoadCount -Descending | Format-Table