-
EddieStevensAMT
- Novice
- Posts: 4
- Liked: never
- Joined: Jan 15, 2026 3:17 pm
- Full Name: Eddie Stevens
- Contact:
Query (used space) in a (Veeam Data Cloud Vault) with PowerShell
Is there any way to use PowerShell to query (used space) in a (Veeam Data Cloud Vault)?
I can query (used space) in local vaults using the following command, but the Veeam Cloud Vault always shows a value of (-1).
foreach ($Repo in get-vbrbackuprepository) {write-host "$($Repo.name): $($Repo.GetContainer().CachedTotalSpace.InBytes)"}
LHR01: 58624162398208
NAS01: 34538752606208
NAS02: 69078509158400
Veeam Cloud Vault: -1
I’ve seen a number of posts relating to this, but they are all either out of date, reference cloud vaults hosted by a third party, or do not apply to Veeam 12 or 13. The information is available in the Veeam console; it shows up under Backup Repositories under Backup Infrastructure. I am really hoping there is a PowerShell command to simply query the (used space) in a (Veeam Data Cloud Vault). Alternatively, does Veeam cache that information locally? Is there a way to query what it displays on the Backup Repositories screen?
I can query (used space) in local vaults using the following command, but the Veeam Cloud Vault always shows a value of (-1).
foreach ($Repo in get-vbrbackuprepository) {write-host "$($Repo.name): $($Repo.GetContainer().CachedTotalSpace.InBytes)"}
LHR01: 58624162398208
NAS01: 34538752606208
NAS02: 69078509158400
Veeam Cloud Vault: -1
I’ve seen a number of posts relating to this, but they are all either out of date, reference cloud vaults hosted by a third party, or do not apply to Veeam 12 or 13. The information is available in the Veeam console; it shows up under Backup Repositories under Backup Infrastructure. I am really hoping there is a PowerShell command to simply query the (used space) in a (Veeam Data Cloud Vault). Alternatively, does Veeam cache that information locally? Is there a way to query what it displays on the Backup Repositories screen?
-
david.domask
- Veeam Software
- Posts: 3238
- Liked: 753 times
- Joined: Jun 28, 2016 12:12 pm
- Contact:
Re: Query (used space) in a (Veeam Data Cloud Vault) with PowerShell
Hi Eddie, welcome to the forums.
CachedTotalSpace relates to the capacity of a repository, not the used space. With the CachedTotalSpace and CachedFreeSpace values you can estimate the used space, but you can also query it with another unsupported method:
[Veeam.Backup.Core.CBackupRepository]::GetRepositoryBackupsSize()
This accepts a Repository GUID as an argument, and returns total size of backups written to the repository.
CachedTotalSpace relates to the capacity of a repository, not the used space. With the CachedTotalSpace and CachedFreeSpace values you can estimate the used space, but you can also query it with another unsupported method:
[Veeam.Backup.Core.CBackupRepository]::GetRepositoryBackupsSize()
This accepts a Repository GUID as an argument, and returns total size of backups written to the repository.
David Domask | Product Management: Principal Analyst
-
EddieStevensAMT
- Novice
- Posts: 4
- Liked: never
- Joined: Jan 15, 2026 3:17 pm
- Full Name: Eddie Stevens
- Contact:
Re: Query (used space) in a (Veeam Data Cloud Vault) with PowerShell
Thank you for your response David…
You are correct about my code showing total space rather than used space. The code I meant to post is:
foreach ($Repo in get-vbrbackuprepository) {$Size = [Math]::Round(($Repo.GetContainer().CachedTotalSpace.InGigaBytes - $Repo.GetContainer().CachedFreeSpace.InGigabytes) / 1024, 1); write-host "$($Repo.name): $($Size)"}
That code generates the following output.
LHR01: 50.2
NAS01: 19.1
NAS02: 20.9
Veeam Cloud Vault: 0
That code shows the used space for each repository, but it does not work for the Veeam Cloud Repository.
I tried the code that you posted: [Veeam.Backup.Core.CBackupRepository]::GetRepositoryBackupsSize()
But when I run that command I get the error: Unable to find type [Veeam.Backup.Core.CBackupRepository].
Is there a module that I need to load to make that work for me?
Also, I am seeing references in other posts indicating that "After updating to Veeam 10, it appears GetRepositoryStoragesSize is no longer a member of Veeam.Backup.Core.CbackupRepository."
Reference URL: powershell-f26/veeam-10-getrepositoryst ... 65281.html
Once again, I am using Veeam B&R 12.3.2 and trying to retrieve the used space in a Veeam Cloud Vault.
Ultimate goal:
I created a scheduled task to run a PowerShell script each day which checks the size of each repository and saves the information to a CSV file along with the date. Then I can analyze the data to look for data storage trends. I have it working for local repositories, but as of now, I have to log into the Veeam console every day and manually document the space used by the Veeam Cloud Repository. I’m really hoping there is a way to automate this process.
You are correct about my code showing total space rather than used space. The code I meant to post is:
foreach ($Repo in get-vbrbackuprepository) {$Size = [Math]::Round(($Repo.GetContainer().CachedTotalSpace.InGigaBytes - $Repo.GetContainer().CachedFreeSpace.InGigabytes) / 1024, 1); write-host "$($Repo.name): $($Size)"}
That code generates the following output.
LHR01: 50.2
NAS01: 19.1
NAS02: 20.9
Veeam Cloud Vault: 0
That code shows the used space for each repository, but it does not work for the Veeam Cloud Repository.
I tried the code that you posted: [Veeam.Backup.Core.CBackupRepository]::GetRepositoryBackupsSize()
But when I run that command I get the error: Unable to find type [Veeam.Backup.Core.CBackupRepository].
Is there a module that I need to load to make that work for me?
Also, I am seeing references in other posts indicating that "After updating to Veeam 10, it appears GetRepositoryStoragesSize is no longer a member of Veeam.Backup.Core.CbackupRepository."
Reference URL: powershell-f26/veeam-10-getrepositoryst ... 65281.html
Once again, I am using Veeam B&R 12.3.2 and trying to retrieve the used space in a Veeam Cloud Vault.
Ultimate goal:
I created a scheduled task to run a PowerShell script each day which checks the size of each repository and saves the information to a CSV file along with the date. Then I can analyze the data to look for data storage trends. I have it working for local repositories, but as of now, I have to log into the Veeam console every day and manually document the space used by the Veeam Cloud Repository. I’m really hoping there is a way to automate this process.
-
david.domask
- Veeam Software
- Posts: 3238
- Liked: 753 times
- Joined: Jun 28, 2016 12:12 pm
- Contact:
Re: Query (used space) in a (Veeam Data Cloud Vault) with PowerShell
Ah, yes apologies; as we're working with unsupported methods, what I proposed was to use .NET Reflection to perform the call instead of the methods on the object.
Your current code also uses unsupported .NET Methods (e.g., GetContainer())
This is not supported and we want to get supported cmdlets to handle this kind of reporting, but for now we need to use unsupported methods.
Before .NET Reflection can work, you need to run a normal Veeam cmdlet within the current session
So process would look like:
That will return the UsedSpace value, but .NET Reflection requires that you first run a normal cmdlet in the current session. Technically I didn't need the first line in my example but included it as that's how I usually "prep" the session.
I am a bit surprised your initial example returned -1, I cannot reproduce that issue on my v12 or v13 labs with VDCV, it returns proper information with the .NET Reflection method
Your current code also uses unsupported .NET Methods (e.g., GetContainer())
This is not supported and we want to get supported cmdlets to handle this kind of reporting, but for now we need to use unsupported methods.
Before .NET Reflection can work, you need to run a normal Veeam cmdlet within the current session
So process would look like:
Code: Select all
Get-VBRLicenseAutoUpdateStatus | Out-Null #picked simply because it's fast and only returns boolen
$repo = Get-VBRBackupRepository -name "Name of your Data Cloud Vault"
[Veeam.Backup.Core.CBackupRepository]::GetRepositoryBackupsSize($repo.id)I am a bit surprised your initial example returned -1, I cannot reproduce that issue on my v12 or v13 labs with VDCV, it returns proper information with the .NET Reflection method
David Domask | Product Management: Principal Analyst
-
EddieStevensAMT
- Novice
- Posts: 4
- Liked: never
- Joined: Jan 15, 2026 3:17 pm
- Full Name: Eddie Stevens
- Contact:
Re: Query (used space) in a (Veeam Data Cloud Vault) with PowerShell
Still no luck...
PS C:\_ps> Get-VBRLicenseAutoUpdateStatus
True
PS C:\_ps> $repo = Get-VBRBackupRepository -name "Veeam Cloud Vault"
PS C:\_ps> $repo
Name Type
---- ----
Veeam Cloud Vault VeeamVault
PS C:\_ps> [Veeam.Backup.Core.CBackupRepository]::GetRepositoryBackupSize($repo.id)
Method invocation failed because [Veeam.Backup.Core.CBackupRepository] does not contain a method named 'GetRepositoryBackupSize'.
PS C:\_ps> Get-VBRLicenseAutoUpdateStatus
True
PS C:\_ps> $repo = Get-VBRBackupRepository -name "Veeam Cloud Vault"
PS C:\_ps> $repo
Name Type
---- ----
Veeam Cloud Vault VeeamVault
PS C:\_ps> [Veeam.Backup.Core.CBackupRepository]::GetRepositoryBackupSize($repo.id)
Method invocation failed because [Veeam.Backup.Core.CBackupRepository] does not contain a method named 'GetRepositoryBackupSize'.
-
david.domask
- Veeam Software
- Posts: 3238
- Liked: 753 times
- Joined: Jun 28, 2016 12:12 pm
- Contact:
Re: Query (used space) in a (Veeam Data Cloud Vault) with PowerShell
Ah I think I had a typo initially:
GetRepositoryBackupsSize
Please try the corrected version, it worked just now on my 12.3.2.3617 installation
But it looks like the class is loaded now at least based on your error, just the method name had a typo hence the "does not contain a method..." error.
GetRepositoryBackupsSize
Please try the corrected version, it worked just now on my 12.3.2.3617 installation
But it looks like the class is loaded now at least based on your error, just the method name had a typo hence the "does not contain a method..." error.
David Domask | Product Management: Principal Analyst
-
EddieStevensAMT
- Novice
- Posts: 4
- Liked: never
- Joined: Jan 15, 2026 3:17 pm
- Full Name: Eddie Stevens
- Contact:
Re: Query (used space) in a (Veeam Data Cloud Vault) with PowerShell
Thanks David. That command did return a value, unfortunately not a meaningful value.
For local repositories, that command does return values which correspond with the values shown in the Veeam console.
But for the "Veeam Cloud Repository" it returns the value 80971762341632.
That number represents approximately 80 TB, but the Veeam console shows that we are only using 29 TB.
While searching for a command to show used space, I recall reading another post where someone said that regardless of the actual space used, their query would always return 80 TB. Unfortunately I cannot find that post and do not know if they were using the same command, but it certainly sounds like the same issue.
I'm not sure if you have any other ideas, but in any case, I want to thank you for your assistance.
Still looking for a way to query used space in a Veeam Cloud Repository with PowerShell.
For local repositories, that command does return values which correspond with the values shown in the Veeam console.
But for the "Veeam Cloud Repository" it returns the value 80971762341632.
That number represents approximately 80 TB, but the Veeam console shows that we are only using 29 TB.
While searching for a command to show used space, I recall reading another post where someone said that regardless of the actual space used, their query would always return 80 TB. Unfortunately I cannot find that post and do not know if they were using the same command, but it certainly sounds like the same issue.
I'm not sure if you have any other ideas, but in any case, I want to thank you for your assistance.
Still looking for a way to query used space in a Veeam Cloud Repository with PowerShell.
-
david.domask
- Veeam Software
- Posts: 3238
- Liked: 753 times
- Joined: Jun 28, 2016 12:12 pm
- Contact:
Re: Query (used space) in a (Veeam Data Cloud Vault) with PowerShell
Glad we got it going, regrettably I cannot explain that value, but I do contest the post that claims it always returns 80 TB. I'm not sure what the difference is between your environment and mine, but I get accurate results.
Unfortunately, we will likely need to wait until we get these properties as part of Powershell / REST API to return values via supported endpoints.
Unfortunately, we will likely need to wait until we get these properties as part of Powershell / REST API to return values via supported endpoints.
David Domask | Product Management: Principal Analyst
Who is online
Users browsing this forum: No registered users and 130 guests