PowerShell script exchange
Post Reply
rboonstra
Service Provider
Posts: 14
Liked: 2 times
Joined: Jun 24, 2016 4:02 pm
Full Name: Robert Boonstra
Location: Netherlands
Contact:

Get RPO per server

Post by rboonstra »

We need to report about the active RPO per server, unfortunatley we don't have Veeam One so Powershell to the rescue. The thing is we use tags to create dynamic jobs, that made it a bit more difficult. I have borowed some parts from other scripts shared here on the forum to create this script

Code: Select all

$VMJobs = Get-VBRBackup | Where-Object {$_.JobType -eq "Backup"}
foreach ($VMjob in $VMjobs.Name)
{ $TagPath = (Find-VBRViEntity -Tags -name $VMjob).Path
$VMs = Find-VBRViEntity -Tags | where {$_.Type -eq "VM" -and $_.path -like "$TagPath*"}
foreach ($VM in $VMs.Name)
{$V =  Get-VBRBackup -Name $VMjob | Get-VBRRestorePoint -Name $VM | measure
$RPO = $V.Count
Write-Output "$VMjob $VM $RPO"}}
My only problem with this solution is that it is too slow. We're protecting 2000+ VM's with Veeam.
Is there a more easy way?
veremin
Product Manager
Posts: 20283
Liked: 2258 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Get RPO per server

Post by veremin »

Find-VBRViEntity is notoriously known for its poor performance. What makes it even worse is the usage of it inside a cycle.

Try to leverage hash table approach, so that your infrastructure gets queried only once.

Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 20 guests