Very cool one liner. Going to try this out tomorrow and see. I am interested to see if we do have clients that will break if we have to upgrade sooner than expected.
A full script to output the versions and their corresponding tenants is here:
Unfortunately it looks like there may be old data in the “Get-CimInstance” query that shows possibly deleted tenant information. The output of my script below should give you the name and version for any active tenants.
# Fetching tenant and version data
$tenants = Get-VBRCloudTenant
$tenver = Get-CimInstance -Query "SELECT * FROM CloudTenantVersionInfo" -Namespace "ROOT\VeeamBS"
# Create an array to hold the merged data
$mergedData = @()
# Loop through each tenant
foreach ($tenant in $tenants) {
# Find matching version data using the Id/InstanceUid match
$matchingVersion = $tenver | Where-Object { $_.InstanceUid -eq $tenant.Id }
# If a match is found, create a combined object
if ($matchingVersion) {
$mergedData += aPSCustomObject]@{
TenantName = $tenant.Name
TenantId = $tenant.Id
TenantEnabled = $tenant.Enabled
VMCount = $tenant.VMCount
ReplicaCount = $tenant.ReplicaCount
LastResult = $tenant.LastResult
ProductVersion = $matchingVersion.ProductVersion
ProtocolVersion = $matchingVersion.ProtocolVersion
}
}
}
# Output merged data
$mergedData
Hope this helps!
That works. Will give it a go tomorrow.
That’s great and very helpful @TylerJurgens, thank you for sharing!
Very cool one liner. Going to try this out tomorrow and see. I am interested to see if we do have clients that will break if we have to upgrade sooner than expected.
The if in this sentence is doing a whole lot of work.
That’s great and very helpful @TylerJurgens, thank you for sharing!
Thanks Jim! Trying to share my knowledge where I can, this compatibility change is causing quite a kerfuffle and I knew I had something that could help, just had to spruce it up to make it better.
As they say, necessity is the mother of all invention.
This is really awesome, Tyler. We have such a great community one of our PMs said when I showed them this.
We will put this QA and see if we can improve or advise for improvement here. Thanks.
Great help here...thanks for posting this Tyler.
This is really awesome, Tyler. We have such a great community one of our PMs said when I showed them this.
We will put this QA and see if we can improve or advise for improvement here. Thanks.
Thanks Tim! The biggest challenge I had here was realizing that WMI Query “ROOT\VeeamBS” contained old information. Unfortunately I could find no official (re: PowerShell) method to gather the actual tenant version hitting the VCC server directly.
@TylerJurgens -- tested your script today and even added output to CSV file to allow me to edit in Excel. Worked extermely well and allowed me to let the higher ups know about our customers still running older versions. Now we can plan carefully for upgrades to our VCC services.
Updated script below. It also lists the last active date and formats the list into a table sorted by the last active date.
# Fetching tenant and version data
$tenants = Get-VBRCloudTenant
$tenver = Get-CimInstance -Query "SELECT * FROM CloudTenantVersionInfo" -Namespace "ROOT\VeeamBS"
# Create an array to hold the merged data
$mergedData = @()
# Loop through each tenant
foreach ($tenant in $tenants) {
# Find matching version data using the Id/InstanceUid match
$matchingVersion = $tenver | Where-Object { $_.InstanceUid -eq $tenant.Id }
# If a match is found, create a combined object
if ($matchingVersion) {
$mergedData += PSCustomObject]@{
TenantName = $tenant.Name
TenantId = $tenant.Id
TenantEnabled = $tenant.Enabled
VMCount = $tenant.VMCount
ReplicaCount = $tenant.ReplicaCount
LastResult = $tenant.LastResult
ProductVersion = $matchingVersion.ProductVersion
LastActive = $tenant.LastActive
ProtocolVersion = $matchingVersion.ProtocolVersion
}
}
}
# Output merged data
$mergedData | Sort -desc LastActive | ft -autosize
If you prefer the list view from the previous entry, just run $mergedData rather than the full string I have including the Sort and ft functions.
Love this one with the “Last Active” included now as that let’s me see which customers have a unsupported version for 12.2. I just create a new PS1 file and added the Export-Csv option like the previous script to output it to file.
@TylerJurgens -- tested your script today and even added output to CSV file to allow me to edit in Excel. Worked extermely well and allowed me to let the higher ups know about our customers still running older versions. Now we can plan carefully for upgrades to our VCC services.
Awesome Chris! Glad you found it useful.
For anyone else, if you want to export it to a CSV, simply run this after.
$mergedData | Sort -desc LastActive | epcsv -NoTypeInformation c:\temp\tenantinfo.csv
As a side note, if the tenant is *brand new* and hasn’t completed one job yet (successfully, or unsuccessfully) the last active date will show “1/1/1900 12:00 AM”
Edit: It may also show the 1/1/1900 date if a job is currently active.
Also, the counts you see here are not for billing purposes. Veeam will show multiple counts if you have the same VM in multiple jobs, while Cloud Connect license metering will only bill that one time. Eg: Backup one VM in 10 jobs and you’ll see the VMCount reflect 10, while Cloud Connect backup licensing will be only 1 instance.
A full script to output the versions and their corresponding tenants is here:
Unfortunately it looks like there may be old data in the “Get-CimInstance” query that shows possibly deleted tenant information.
It’s possible to locate and remove the deleted tenant information, but it takes a few steps and requires touching the database itself (SQL, in my case):
Step 1:
Get a sorted list of ALL tenants (active and deleted) that are detected
Get-CimInstance -Query "SELECT * FROM CloudTenantVersionInfo" -Namespace "ROOT\VeeamBS" | select TenantID, ProductVersion | Sort-Object TenantID
Step 2:
Get a sorted list of all active tenants
$mergedData | select TenantName, TenantID, ProductVersion | sort-object ProductVersion, TenantName
Step 3:
Compare the two lists using your comparison tool of choice (I used Excel) and remove the matches
Step 4:
WARNING: unsupported database manipulation lies ahead. Take a good backup first!
WARNING 2: do not perform this on tenants that appeared in the results of Step 2!
Within SQL, run the following query:
delete FROM >VeeamCloudConnect].ldbo].nBackup.Model.CloudSessions] where tenant_name = 'nTENANT_ID]'
Where pTENANT_ID] is the id of one of the deleted tenants. Rerun ‘Step 1’ to confirm the deleted tenant has been deleted. Rinse and repeat, as desired.
(thanks to Ely Assogba of Veeam Support who worked on this issue with me)