Super Simple Get-VBRBackupSession

PowerShell script exchange

Super Simple Get-VBRBackupSession

Veeam Logoby AllSorts » Wed Dec 30, 2015 8:55 pm

Looking for something really simply in Powershell to do the follow:

Show all jobs run in the last 30 days. I need the name, type (backup or duplicate), date run, status and amount of data each job backed up or duplicated to tape. All the PS scripts I've seen are way too complicated for what I need. I've been trying to get objects out of Get-VBRBackupSession but haven't been successful yet at getting all the info I need. Could someone please point me in the right direction.

Posts: 1
Liked: never
Joined: Wed Dec 30, 2015 7:45 pm
Full Name: Rob Carr

Re: Super Simple Get-VBRBackupSession

Veeam Logoby tsightler » Thu Dec 31, 2015 2:43 am

I believe this little one-liner gets a lot of what you need, although I don't think tape sessions are returned by Get-VBRBackupSession so that might need something else:

Code: Select all
Get-VBRBackupSession | ?{$_.CreationTime -ge (Get-Date).AddDays(-30)} | Select JobName, JobType, CreationTime, Result, @{Name="BackupSize";Expression={$_.BackupStats.BackupSize}} | Sort CreationTime | Format-Table

BTW, I'm not sure if you wanted source data size or backup data size after compression/dedupe, so I went with the latter. If you want the size of the source data you can change BackupSize to DataSize.
Veeam Software
Posts: 4932
Liked: 1856 times
Joined: Fri Jun 05, 2009 12:57 pm
Full Name: Tom Sightler

Re: Super Simple Get-VBRBackupSession

Veeam Logoby v.Eremin » Thu Jan 07, 2016 8:40 am

Also, Get-VBRBackupSession doesn't return tape job sessions, in order to get them leverage Get-VBRSession commandlet. Thanks.
Veeam Software
Posts: 14037
Liked: 1051 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Return to PowerShell

Who is online

Users browsing this forum: No registered users and 1 guest