Veeam Cloud Connect allows service providers to charge their costumers on the base of multiple parameters, but together with used space license consumption is surely one of the most common. This script allows service providers to configure an automatic usage reporting.
Manual report
In the user interface, the way to check the usage of Veeam Cloud Connect is via the console: by opening the main menu and selecting License, the operator can reach this info box:
By hitting the button Report… an additional box appears:
From here, providers can print or save the report as a pdf or as a json file (for further processing).
But, obviously, it’s way better to automate the entire process, and that’s what this script does.
The script
$vbrserver = "vbr.domain.local" $vbruser = "Administrator" $vbrpwd = "password" asnp "VeeamPSSnapIn" -ErrorAction SilentlyContinue Connect-VBRServer -Server $vbrserver -User $vbruser -Password $vbrpwd $csvFileName = "vcc_report.csv" $tenantlist = Get-VBRCloudTenant $results = @() foreach ($tenant in $tenantlist) { $details = [ordered]@{ Tenant = $tenant VM_Backup = $Tenant.VMCount VM_Replica = $tenant.ReplicaCount Wks_Backup = $tenant.WorkstationCount Srv_Backup = $tenant.ServerCount } $results += New-Object PSObject -Property $details } $results | export-csv -Path $csvFileName -NoTypeInformation Disconnect-VBRServer
The script connects to the Cloud Connect server, retrieves the list of the tenants, and for each of them reads the amount of the consumed licenses for each type of protected resources: Backup VM, Replica VM, workstations and Servers. Then, puts all those data into a CSV file that is formatted like this:
"Tenant","VM_Backup","VM_Replica","Wks_Backup","Srv_Backup" "Tenant3","1","0","0","0" "Tenant1","3","0","0","0" "Tenant2","1","0","0","0"
You can then parese the CSV file with any exernal tool, from simple Microsoft Excel to different chargeback/billing systems.
NOTE: if you want to obtain the same information via API, please note there’s a hotfix to be applied to the Veeam Enterprise Manager server on top of 9.5 Update 4. Please ask Veeam support for the bits and be sure that the starting point is an installation with version 9.5.4.2615.