Skip to main content

[PowerShell] Get All Backup Repositories Advanced


Markus.K1985
Forum|alt.badge.img+3
[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

Forum|alt.badge.img

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}}
 

 


Chris.Childerhose
Forum|alt.badge.img+21
Cenitbackup wrote:

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:


Link State
Forum|alt.badge.img+11
  • Veeam Legend
  • 605 comments
  • June 3, 2021

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


Forum|alt.badge.img

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

 


Chris.Childerhose
Forum|alt.badge.img+21
Link State wrote:

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.


Link State
Forum|alt.badge.img+11
  • Veeam Legend
  • 605 comments
  • June 3, 2021
Chris.Childerhose wrote:
Link State wrote:

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.Childerhose
Forum|alt.badge.img+21
Link State wrote:
Chris.Childerhose wrote:
Link State wrote:

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.


Link State
Forum|alt.badge.img+11
  • Veeam Legend
  • 605 comments
  • June 3, 2021

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


Forum|alt.badge.img
  • Not a newbie anymore
  • 1 comment
  • November 19, 2021
Cenitbackup wrote:

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


Forum|alt.badge.img+3
  • Comes here often
  • 112 comments
  • November 24, 2021
StevenA wrote:

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