-
- Expert
- Posts: 196
- Liked: 13 times
- Joined: Feb 05, 2011 5:09 pm
- Full Name: Brian Rupnick
- Location: New York, USA
- Contact:
Include Job Name in Get-VBRRestorePoint
Good morning-
Is there a way to run Get-VBRRestorePoint for a particular VM and have it return the name of the job that created the point? I'm trying to create a report that will give me the number of restore points for all the VMs in my environment. I'm using VMware tags to build my jobs, so I don't know the name of the job that a particular VM is in without running Get-VM to pull the tags. Unfortunately, running Get-VM for every VM in my environment is very slow and if I can get this from Get-VBRRestorePoint, it will save me quite a bit of time.
Any other suggestions are also welcomed.
Thanks!
Is there a way to run Get-VBRRestorePoint for a particular VM and have it return the name of the job that created the point? I'm trying to create a report that will give me the number of restore points for all the VMs in my environment. I'm using VMware tags to build my jobs, so I don't know the name of the job that a particular VM is in without running Get-VM to pull the tags. Unfortunately, running Get-VM for every VM in my environment is very slow and if I can get this from Get-VBRRestorePoint, it will save me quite a bit of time.
Any other suggestions are also welcomed.
Thanks!
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Include Job Name in Get-VBRRestorePoint
Try the following script:
Thanks.
Code: Select all
Get-VBRRestorePoint | select name, {$_.FindSourceJob().name}
-
- Expert
- Posts: 196
- Liked: 13 times
- Joined: Feb 05, 2011 5:09 pm
- Full Name: Brian Rupnick
- Location: New York, USA
- Contact:
Re: Include Job Name in Get-VBRRestorePoint
This is exactly what I was looking for. Thank you!
Now is there a quicker way to get the number of restore points for a particular VM? Right now, I'm using this
and it takes about 25 seconds to execute. With over 1,000 servers in my environment, you can see how this would be problematic. Ultimately, I'm looking to create a report that shows all the VMs in my environment along with the number of VBR restore points available.
Now is there a quicker way to get the number of restore points for a particular VM? Right now, I'm using this
Code: Select all
$(Get-VBRRestorePoint -Name "SERVERNAME").Count
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Include Job Name in Get-VBRRestorePoint
Besides counting actual restore points, nothing comes from the top of my head. As a side option, you can take a look at Veeam ONE (part of Availability Suite) that has reports you're looking for.
-
- VP, Product Management
- Posts: 6035
- Liked: 2860 times
- Joined: Jun 05, 2009 12:57 pm
- Full Name: Tom Sightler
- Contact:
Re: Include Job Name in Get-VBRRestorePoint
There are quite a number of ways to optimize, but one of the simplest is to minimize the number of times you have to call Get-VBRRestorePoint by just grabbing all of the points into a variable at once, so instead of your line above you would do:brupnick wrote:Now is there a quicker way to get the number of restore points for a particular VM? Right now, I'm using thisand it takes about 25 seconds to execute. With over 1,000 servers in my environment, you can see how this would be problematic. Ultimately, I'm looking to create a report that shows all the VMs in my environment along with the number of VBR restore points available.Code: Select all
$(Get-VBRRestorePoint -Name "SERVERNAME").Count
Code: Select all
$restorepoints = Get-VBRRestorePoint
Code: Select all
($restorepoints.Name -eq "SERVERNAME").Count
Code: Select all
(Get-VBRRestorePoint).Name | group | %{$rpcounts = @{}} {$rpcounts[$_.Name] = $_.Count}
Code: Select all
$rpcounts["SERVERNAME"]
Code: Select all
$rpcounts = $rpcounts.GetEnumerator() | Sort-Object Name
Code: Select all
Name Value
---- -----
Apache_Web 22
dc01 40
dc02 55
exch01 21
exch2013 22
guac01 14
it-vm01 14
it-vm03 14
it-vm04 14
LAMP_vApp 14
-
- Expert
- Posts: 196
- Liked: 13 times
- Joined: Feb 05, 2011 5:09 pm
- Full Name: Brian Rupnick
- Location: New York, USA
- Contact:
Re: Include Job Name in Get-VBRRestorePoint
Tom, you are officially my new hero. What used to take 2+ hours is now down to 12 minutes thanks to you.
Here's what I ended up with, since I wanted to get the name of the job that processed the VM as well, and break them up as such:
The one thing that I noticed with this is that FindSourceJob() only returns values for current jobs; if a VM exists because it was imported, the imported job name will not be returned (but the restore points will). Is there a better way to retrieve this information for all VMs, including those that have been imported?
Again, THANK YOU so much for your help.
Here's what I ended up with, since I wanted to get the name of the job that processed the VM as well, and break them up as such:
Code: Select all
Get-VBRRestorePoint | Select Name, @{N="Job Name";E={$_.FindSourceJob().name}} | Group Name,"Job Name" -NoElement | Sort Name
Again, THANK YOU so much for your help.
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Include Job Name in Get-VBRRestorePoint
What if you try this code, instead:
Thanks.
Code: Select all
Get-VBRRestorePoint | Select Name, @{N="Job Name";E={$_.FindBackup().Jobname}} | Group Name,"Job Name" -NoElement | Sort Name
-
- Expert
- Posts: 196
- Liked: 13 times
- Joined: Feb 05, 2011 5:09 pm
- Full Name: Brian Rupnick
- Location: New York, USA
- Contact:
Re: Include Job Name in Get-VBRRestorePoint
Man, you guys are awesome. Thanks so much!!
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Include Job Name in Get-VBRRestorePoint
You're welcome. Don't hesitate to contact us, if other questions arise.
Who is online
Users browsing this forum: No registered users and 6 guests