Append String to Veeam Tapes in Media Pool via Powershell
Today I needed to add a couple of tapes in a Media Pool and the customer asked me if I could append a string to the tape name. Having added around ~30 tapes in the pool it would have required a lot of clicking to do it from the Veeam Backup Console.For this reason I decided to allocate the same time to script it.
As a result I compiled the below script. It will function as follows:
It will get the list of tapes in the media pool named “Daily – LTO 7”, as per the $MediaPoolName constant, and will append ” – Daily”, as specified in $appendname, to the current tape name.
The $MediaPoolName and $appendname constants should be changed for your specific use.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | #Import VBR PS Snapin Add-PSSnapin VeeamPSSnapin #Media Pool Name $MedialPoolName="Daily - LTO 7" #String to Append to the name $appendname=" - Daily" #Get list of tapes in the Media Pool Specified above $tapes=Get-VBRTapeMedium -MediaPool $MedialPoolName #Renaming of the tapes takes place here foreach ($tape in $tapes){ $newtapename =$tape.Name+$appendname Write-Host $tape.name renamed to $newtapename Set-VBRTapeMedium -Medium $tape -name $newtapename } |

You can see that it is very straight forward. I try to explain as much as I can for people that are new to powershell.
As always leave a comment below should you have found it useful or would like to make suggestions.
Thanks for visiting