PowerShell script exchange
Post Reply
odruard
Enthusiast
Posts: 40
Liked: 5 times
Joined: Jan 25, 2011 2:12 pm
Full Name: Olivier Druard
Contact:

Get-VBRBackupSession members

Post by odruard »

Hello,

I'm trying to create some reports using PowerShell, using VeeamBackup 5.0.2.224 (64bit)

I wanted to use applet Get-VBRBackupSession :

Code: Select all

C:\exploit> Get-VBRBackupSession | where-object { $_.name -eq 'TEST_JOB'}

Job Name             State      Start Time             End Time               Result
--------             -----      ----------             --------               ------
TEST_JOB             Stopped    25/10/2011 10:21:54    25/10/2011 10:22:36    Failed
TEST_JOB             Stopped    26/10/2011 10:00:14    26/10/2011 10:00:59    Success
Result is interesting, and I wanted to use Start Time and End Time informations.
However I can't find how to handle them.
Get-Member doesn't list these properties :

Code: Select all

C:\exploit> Get-VBRBackupSession | get-member -membertype Property

   TypeName: Veeam.Backup.Core.CBackupSession

Name     MemberType Definition
----     ---------- ----------
Id       Property   System.Guid Id {get;}
Info     Property   Veeam.Backup.Model.CBackupSessionInfo Info {get;}
JobId    Property   System.Guid JobId {get;}
JobType  Property   Veeam.Backup.Model.EDbJobType JobType {get;}
Logger   Property   Veeam.Backup.Core.XmlLogger Logger {get;}
Name     Property   System.String Name {get;}
Progress Property   Veeam.Backup.Model.CProgressData Progress {get;}
Result   Property   Veeam.Backup.Model.CBaseSessionInfo+EResult Result {get;}
State    Property   Veeam.Backup.Model.CBaseSessionInfo+EState State {get;}
None of these properties are Start Time or End Time.
I tried to use several property names as 'starttime', 'start-time', 'start_time'... without success.

Do you have some idea on this ?

Thanks for any help.
Olivier Druard
Sethbartlett
Veteran
Posts: 282
Liked: 26 times
Joined: Nov 10, 2010 6:51 pm
Full Name: Seth Bartlett
Contact:

Re: Get-VBRBackupSession members

Post by Sethbartlett »

You have to drill down through progress. Example code:

Code: Select all

$Session = Get-VBRBackupSession | ?{$_.name -eq "Job Name"}
$Session[0].Progress.StartTime
$Session[0].Progress.StopTime
Everything you need should be in Progress.
Skype: Sethbartlett88 - Make sure to label who you are and why you want to add me ;)
Twitter: @sethbartlett
If my post was helpful, please like it. Sometimes twitter is quicker to hit me up if you need me.
odruard
Enthusiast
Posts: 40
Liked: 5 times
Joined: Jan 25, 2011 2:12 pm
Full Name: Olivier Druard
Contact:

Re: Get-VBRBackupSession members

Post by odruard »

Nice !
Thanks.

I really need to upgrade my PowerShell skills...

Is there somewhere detailed informations about Veeam applets ?

Olivier Druard
Gostev
Chief Product Officer
Posts: 31835
Liked: 7325 times
Joined: Jan 01, 2006 1:01 am
Location: Baar, Switzerland
Contact:

Re: Get-VBRBackupSession members

Post by Gostev »

All cmdlets have built-in help, and there is plenty of samples on these forums!
marius roma
Veteran
Posts: 459
Liked: 5 times
Joined: Feb 01, 2012 12:04 pm
Full Name: Mario
Contact:

Re: Get-VBRBackupSession members

Post by marius roma »

I apologize for the very basic question.
How can I get a list of members of .Progress?
Regards
Marius
Sethbartlett wrote:You have to drill down through progress. Example code:

Code: Select all

$Session = Get-VBRBackupSession | ?{$_.name -eq "Job Name"}
$Session[0].Progress.StartTime
$Session[0].Progress.StopTime
Everything you need should be in Progress.
veremin
Product Manager
Posts: 20439
Liked: 2309 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Get-VBRBackupSession members

Post by veremin »

Use Get-Member commandlet:

Code: Select all

$Session[0].Progress | Get-Member
Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 17 guests