Hope all are well and somebody is feeling fresh enough to offer any advice.
I am by no means a scripter but I am working on building two scripts to grab month-end reporting data for VCSP & VBO365 (later). Where I am struggling is to get the Licensed Edition of the Tenant (Standard, Enterprise, Enterprise+) etc. I can find this via Swagger in the API but the script I am working on is PS. (If anybody may be interested to guide me on learning material of where to start wrt accessing and exporting API data, that is something I am quite keen on learning too).
At this point I have this:
Code: Select all
//Creds to be replaced by XML method//
$vbrserver = "localhost"
$vbruser = "REMOVED"
$vbrpwd = "REMOVED"
asnp "VeeamPSSnapIn" -ErrorAction SilentlyContinue
Connect-VBRServer -Server $vbrserver -User $vbruser -Password $vbrpwd
$csvFileName = "MC_vcc_report.csv"
$tenantlist = Get-VBRCloudTenant
$quotalist = Get-VBRCloudTenant | select name , {$_.Resources.usedspace},{$_.Resources.repositoryQUota}
$results = @()
foreach ($tenant in $tenantlist) {
$details = [ordered]@{
Tenant = $tenant
VM_Licenses = $Tenant.RentalVMBackupCount
Wks_Licenses = $tenant.RentalWorkstationBackupCount
Srv_Licenses = $tenant.RentalServerBackupCount
New_VM_Licenses = $tenant.NewVMBackupCount
New_Wks_Licenses = $tenant.NewWorkstationBackupCount
New_Srv_Licenses = $tenant.NewServerBackupCount
Quota_Used_MB = $tenant.Resources.usedspace
Quota_Allocated_MB = $tenant.Resources.repositoryQuota
}
$results += New-Object PSObject -Property $details
}
$results | export-csv -Path $csvFileName -NoTypeInformation
Disconnect-VBRServer
https://www.dropbox.com/s/2y51b7eobq7fd ... e.PNG?dl=0
The 2 things I'd like to add to this are:
1. Get the License Edition and add it between Tenant & VM_Licenses
2. Automatically calculate the MB under repo's to GB's
Really hoping for some input from the Forum.
Thanks for reading.