Greetings friends, I have seen this request come a few times on the forums for the past months. The idea is simple, get the great VBR HTML report about licensing, delivered to your email comfortably. Like once a week, or a month, or even on demand.
Why is this important?
Since the transition from perpetual to VUL, Customers now pay more attention to the license and the current consumption. Sometimes curious about usage, and other times just to confirm that the workload that was decommissioned it is not taking more license for example.
Stay with me to get this great, same VBR report only when you guys really need it:
Building blocks and logic
I have used PowerShell to simplify the backup administrator life, the final flow looks something like this:
- We should download the script, and review it and do our due diligence – https://github.com/jorgedlcruz/veeam-html-reporting/tree/main/veeam-backup-and-replication
- Make sure you run this from Veeam Backup & Replication, or a server with the VBR Power-shell module
- Create a Microsoft Azure Application capable of sending email, get a secret, etc.
- Make sure we have the module MSPAL.PS
Microsoft Azure Application to send Mails
This is the evolution of the older SMTP Servers where we just spammed some user/pass and there you go. Now it is a bit more complex, but for those familiarised with Microsoft Azure a piece of cake. Anyways, let’s make sure we have an App Registration with the next permissions:
If we do, or when we do. Let’s create some secret for it:
We will need the Client ID as well, that we can find under Overview of the App Registration:
Save this secret value and add it to the script as well.
Making sure we have MSPAL.PS
To send emails, and basically to authenticate in Microsoft Azure services, we will need MSPAL.PS it is the standard, all the information can be found here. Installing it is just one line as an admin of the machine:
Install-Module -Name MSAL.PS -Force -AllowClobber
Putting it all together, and running it
Alright, if we have followed all nicely, the last step is just to fill the script parameters:
# Global Parameters $timestamp = Get-Date -Format "yyyyMMdd_HH_mm_ss" $reportFileName = "VBR_License_Report_$timestamp" $outputPath = "$PSScriptRoot\$reportFileName" $RecipientEmail = "[email protected]" $TenantId = "YOURMS365TENANT.onmicrosoft.com" $ClientId = "YOURCLIENTID" $ClientSecret = ConvertTo-SecureString "YOURAPPSECRET" -AsPlainText -Force
If we are all happy and ready, let’s get some colours! The script has a lot of console debug for those who will be watching while running, but that is not the main use-case I guess:
How does it look like by email? Well, just an email with an HTML attached 🙂
Next steps
The next steps would be to fine-tune the script, as you can save it as well as JSON, and perhaps do more better stuff with it.
Another interesting step will be to create an scheduled task in this windows system to receive this email weekly/monthly, etc.
Leave a Reply