I have tried to write a ps script that will list and email the tapes used each day, I thought to search using the media pool date as a reference. But I am getting no results, below is what I have come up with:
Thanks this works very well. I would like to add to this command the ability to only include tape that are still in the library (i.e. have the script run twice a day, and the script should ignore any tapes already removed after the script has ran the first time). I have come up with this command:
asnp VeeamPSSnapin
$date = (get-date).ToShortDateString()
#SMTP server name
$smtpServer = "smtp.weatherbys.local"
#Creating a Mail object
$msg = new-object Net.Mail.MailMessage
#Creating SMTP server object
$smtp = new-object Net.Mail.SmtpClient($smtpServer)
#Email structure
$msg.From = "grp-man-bkp01@weatherbys.co.uk"
$msg.ReplyTo = "grp-man-bkp01@weatherbys.co.uk"
$msg.To.Add("itoperationsteam@weatherbys.local")
$msg.subject = "Wellingbourgh Veeam Backup Server - Tapes to request back from Iron Mountain"
$line1 = Get-VBRTapemedium | where ({$_.Mediaset.name -like "*$date*"} -and {$_.Location -like "*Slot*"}) | select Name | Format-Table -Property Name | out-string
$line2 = "Remove these tapes from the Veeam library and send offsite with the Iron Mountain Courier."
$msg.body = "$line1`n`n$line2"
#Sending email
$smtp.Send($msg)
The "{S_.Location -line "Slot"} works on it own to list tapes in the library, but with the "{S_mediaset.name -like "*$date*"} the result is no tapes listed.
Alan, we are also working on the corresponding report for Veeam One, to deliver our customers from the Powershell.
If you have any recommendations on the info to be shown in the report, please let me know. Thanks!
I had the same sort of requirement where I needed to list all the tapes that needed to be ejected from our tape loader. I thought it would be worthwhile to post this and found that it is very similar to your script (which I think it is really good by the way). I did put my response in an html format which works well for our guys, however is not required.