List of Tapes and load count


Userlevel 7
Badge +8

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


 


3 comments

Userlevel 7
Badge +20

Well, another one I have saved to my scripts folder.  This will come in handy as we have a service with Iron Mountain that uses Veeam and tape.  😎

Userlevel 7
Badge +8

I’m not into tapea buddy!

if I ever get into this “mud” I will give you a shout!!

script saved in my home repo!!

thanks!

cheers!!

Userlevel 5
Badge +7

This one can become usefull sometime. Thanks for sharing @Scott 

Comment