[PowerShell] Get All Backup Repositories Advanced


Userlevel 3
Badge
[Array]$RepoList = Get-VBRBackupRepository | Where-Object {$_.Type -ne "SanSnapshotOnly"} 
[Array]$ScaleOuts = Get-VBRBackupRepository -ScaleOut
if ($ScaleOuts) {
foreach ($ScaleOut in $ScaleOuts) {
$Extents = Get-VBRRepositoryExtent -Repository $ScaleOut
foreach ($Extent in $Extents) {
$RepoList = $RepoList + $Extent.repository
}
}
}
$RepoList | Select-Object Name, Path, `
@{Name="CachedTotalSpaceGB"; Expression= {[Math]::Round([Decimal]$_.info.CachedTotalSpace/1GB,2)}}, `
@{Name="CachedFreeSpaceGB"; Expression= {[Math]::Round([Decimal]$_.info.CachedFreeSpace/1GB,2)}} | Format-Table -AutoSize

 


10 comments

Userlevel 2

Hello, 

Update to V11

[Array]$RepoList = Get-VBRBackupRepository | Where-Object {$_.Type -ne "SanSnapshotOnly"} 
[Array]$ScaleOuts = Get-VBRBackupRepository -ScaleOut
if ($ScaleOuts) {
    foreach ($ScaleOut in $ScaleOuts) {
        $Extents = Get-VBRRepositoryExtent -Repository $ScaleOut
        foreach ($Extent in $Extents) {
            $RepoList = $RepoList + $Extent.repository
        }
    }
}

$RepoList | Select-Object @{n='Name';e={$_.Name}},@{n='Type';e={$_.type}},  @{n='Path';e={$_.path}}, @{n='Size';e={$_.GetContainer().CachedTotalSpace.InGigabytes}}, @{n='FreeSpace';e={$_.GetContainer().CachedFreeSpace.InGigabytes}}
 

 

Userlevel 7
Badge +8

Hello, 

Update to V11

[Array]$RepoList = Get-VBRBackupRepository | Where-Object {$_.Type -ne "SanSnapshotOnly"} 
[Array]$ScaleOuts = Get-VBRBackupRepository -ScaleOut
if ($ScaleOuts) {
    foreach ($ScaleOut in $ScaleOuts) {
        $Extents = Get-VBRRepositoryExtent -Repository $ScaleOut
        foreach ($Extent in $Extents) {
            $RepoList = $RepoList + $Extent.repository
        }
    }
}

$RepoList | Select-Object @{n='Name';e={$_.Name}},@{n='Type';e={$_.type}},  @{n='Path';e={$_.path}}, @{n='Size';e={$_.GetContainer().CachedTotalSpace.InGigabytes}}, @{n='FreeSpace';e={$_.GetContainer().CachedFreeSpace.InGigabytes}}
 

 

Nice work on the update.  Works very well and shows all repos in Veeam. :sunglasses:

Userlevel 7
Badge +4

Added new powershell part relating to the Repository info for the My veeam Report for version V11

I link the discussion on the forum

I link the discussion on the forum

My Veeam Report v9.5.1 - Page 4 - Veeam R&D Forums

Userlevel 2

Hello,

Great job Chris, you could implement new options that I have seen that do not work like the Agents, I am not quite good with Powershell, but I have taken some things that do not come out in the report.

 

Thanks

 

Userlevel 7
Badge +8

Added new powershell part relating to the Repository info for the My veeam Report for version V11

I link the discussion on the forum

I link the discussion on the forum

My Veeam Report v9.5.1 - Page 4 - Veeam R&D Forums

Looking forward to the changes that are be doing to update this entire reporting script to v11.  I  use the v10 all the time.

Userlevel 7
Badge +4

Added new powershell part relating to the Repository info for the My veeam Report for version V11

I link the discussion on the forum

My Veeam Report v9.5.1 - Page 4 - Veeam R&D Forums

Looking forward to the changes that are be doing to update this entire reporting script to v11.  I  use the v10 all the time.

who updates the whole script?

Userlevel 7
Badge +8

Added new powershell part relating to the Repository info for the My veeam Report for version V11

I link the discussion on the forum

My Veeam Report v9.5.1 - Page 4 - Veeam R&D Forums

Looking forward to the changes that are be doing to update this entire reporting script to v11.  I  use the v10 all the time.

who updates the whole script?

Chris Arceneux will be updating it as per page 5 of that forum post.

Userlevel 7
Badge +4

lol , missed to read chris's message :joy: thx

Badge

Hello, 

Update to V11

[Array]$RepoList = Get-VBRBackupRepository | Where-Object {$_.Type -ne "SanSnapshotOnly"} 
[Array]$ScaleOuts = Get-VBRBackupRepository -ScaleOut
if ($ScaleOuts) {
    foreach ($ScaleOut in $ScaleOuts) {
        $Extents = Get-VBRRepositoryExtent -Repository $ScaleOut
        foreach ($Extent in $Extents) {
            $RepoList = $RepoList + $Extent.repository
        }
    }
}

$RepoList | Select-Object @{n='Name';e={$_.Name}},@{n='Type';e={$_.type}},  @{n='Path';e={$_.path}}, @{n='Size';e={$_.GetContainer().CachedTotalSpace.InGigabytes}}, @{n='FreeSpace';e={$_.GetContainer().CachedFreeSpace.InGigabytes}}
 

 

Has anybody have an idea if the number of files in a repository can be shown as well?

I have been looking for this some time now but I have not yet found it.

regards

Steven

Userlevel 4
Badge

Has anybody have an idea if the number of files in a repository can be shown as well?

I have been looking for this some time now but I have not yet found it.

regards

Steven

Do you mean like the count of backup files @StevenA  ?

CBackupRepository Objects have the GetBackups() method, and CBackup objects have the GetAllChildrenStorages() method.

You can string these together like so:

 

PS C:\Users\Administrator> $repo.GetBackups().GetAllChildrenStorages().count
70

Remove the .count call and you will get an array of Storages (backup files) on a repository.

Note that this is only about what Veeam is aware of; that is, if there are orphaned points not visible in the Veeam UI, this method will not help (no Veeam powershell cmdlet will).

Comment