Hi Gostev,
Thanks for your attention to this.
That would definitely need to be an option (not fully automatic) - I'd suggest Opt In as there might be a valid reason to remove the tenant and not the backups and any time there's a chance of deleting backups the default answer should always be "DO NOT DELETE THE BACKUPS!" - because as you know, people (like me) don't RTFM
I'm trying to work through the process to do this in PowerShell (starting with the tenant name) and it's surprisingly torturous. That's something that each SP would likely need to write to suit their particular way of deploying the multi-tenant. For example - we use a repo per tenant (with or without object repo), but I know some use one repo for multiple tenants. I don't think there's much Veeam can do here to make the PoSh route easier.
One thing I notice is that Remove-VBOLicensedUser states
IMPORTANT
You must remove user data from the backup repository before removing a license from Veeam Backup for Microsoft 365 users. Run the Remove-VBOEntityData cmdlet to remove the user data.
I've assumed that removing the repo will achieve the same thing and skip the overhead of actually purging each user's backup from the repo. That begs the question - if the tenant is the only tenant in the repo, should the GUI offer to remove the whole repo (quick) rather than enumerate every user in the organisation and run purge their backup data from the repo (which I assume will be much slower).
As I understand it, a VBO license is only consumed to back up a user - not to restore them.
https://helpcenter.veeam.com/docs/vbo36 ... tml?ver=60
Licensing in Veeam Backup for Microsoft 365 is based on user accounts whose data you back up; each protected user account consumes one unit of the license.
If that's true, then there's no reason to require the user's backups to be released before removing the license from the user. This would vastly reduce the complexity of the process, and make it much easier for the GUI to achieve without spending potentially significant time thrashing the storage removing individual backups (from a repo we'd delete anyway).
I know what you mean about the first month free - and I partly agree, but the finance people like the numbers to line up each month and I pretty much agree with them. In this case we paid for 29 days in Jan when there was no backup, and then because the 31 days expired on 2nd Feb we paid for 28 days (another month) in Feb where there was no backup. Revoking the licenses when the tenant was removed would have cut this down to just the 29 days in December which is fine with us.
Thanks
