PowerShell script exchange
rboonstra
Service Provider
Posts: 14 Liked: 2 times
Joined: Jun 24, 2016 4:02 pm
Full Name: Robert Boonstra
Location: Netherlands
Contact:
Post
by rboonstra » Dec 20, 2016 1:59 pm
this post
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: 20415 Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:
Post
by veremin » Dec 20, 2016 2:20 pm
this post
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.
Users browsing this forum: No registered users and 6 guests