I'm trying to get some occupancy information for my Veeam storage.
To get this information for each machine I have configured the repository to use per-machine backup files.
I collect information about each backup file and add up their occupancy to get a machine's total occupancy.
In my script I use Get-VBRBackup to get a list of backups. For each backup I get the objects and storages like this:
Code: Select all
$backups = Get-VBRBackup
foreach ($backup in $backups) {
if ($backup) {
$objects = $backup.GetObjects()
$allStorages = $backup.GetAllStorages()
foreach ($object in $objects) {
$x = "^" + [Regex]::Escape($object.Name + ".")
$objectRe = New-Object Regex $x, 'Compiled'
$storages = $allStorages | Where-Object { $_.PartialPath -match $objectRe }
foreach ($storage in $storages) {
$stats = $storage.Stats
# Here I use some class to store the object's name, backup size, etc. for every backup file.
# To get the total occupancy I add all the values per unique object name in a later step.
}
}
}
This works fine for VMWare backups, but for NAS/SMB backup I can't seem to get the information about the occupancy.
The command Get-VBRNASBackup shows the configured NAS backup, but I can't get any information about the storage from the output.
Is there a way to get similar information for NAS backups as in the script above?