PowerShell script exchange
Post Reply
frenou
Veeam ProPartner
Posts: 1
Liked: never
Joined: Apr 19, 2011 2:51 pm
Full Name: RENOU Frederic
Contact:

Get-VBRComputerBackupJobSession

Post by frenou »

Hello,
I can't get the following information in my script :

.BackupStats.BackupSize
.BackupStats.datasize

Here is my code:

Code: Select all

$JobsComputer =Get-VBRComputerBackupJob

foreach ($JobComputer in $JobsComputer) 
{ 
$jname = Get-VBRComputerBackupJobSession -Name "$($JobComputer.Name)?*" 
$jname1=$jname | Sort-Object -Descending -Property CreationTime | select -First 1

foreach ($JobComputer in $jname1) 
{
Get-VBRTaskSession -Session $JobComputer[0] | Select-Object -Property Name, `

@{Name='Jobname';Expression={$($Sessions.Name)}},

##@{Name='Creationtime2';Expression={$_.Progress.StartTimeLocal}}, 
@{Name="Creationtime";Expression={$($JobComputer.Creationtime)}},
##@{Name='EndTime2';Expression={$_.Progress.StopTimeLocal}},
@{Name='EndTime';Expression={$($JobComputer.EndTime)}},
@{Name="Result";Expression={$($JobComputer.result)}},
@{Name="State";Expression={$($JobComputer.state)}},


## -----------------------
@{Name="BackupSize";Expression={$_.BackupStats.BackupSize}},
@{Name="DataSize";Expression={$_.BackupStats.datasize}},
##------------------------


@{Name="Heures";Expression={$_.Progress.Duration.Hours}},
@{Name="Minutes";Expression={$_.Progress.Duration.Minutes}},
@{Name="Secondes";Expression={$_.Progress.Duration.seconds}},
@{Name='AvgSpeedMB';Expression={$_.Progress.AvgSpeed}},
@{Name='ProcessedGB';Expression={[math]::Round(($_.Progress.ProcessedUsedSize)/1GB,2)}},
@{Name='DataReadGB';Expression={[math]::Round(($_.Progress.ReadSize)/1GB,2)}},
@{Name='TransferredGB';Expression={[math]::Round(($_.Progress.TransferedSize)/1GB,2)}}
}
}
 

do you have any idea of my mistake? thank you
Mildur
Product Manager
Posts: 8735
Liked: 2296 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: Get-VBRComputerBackupJobSession

Post by Mildur »

Hi Renou

I see the same behavior in my lab.
I'm not sure, if we have this information for Veeam Agent Jobs in the BackupStats.
I will check that for you and give you a feedback. It could take a while because of the holiday season.

Thanks
Fabian
Product Management Analyst @ Veeam Software
oleg.feoktistov
Veeam Software
Posts: 1918
Liked: 636 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Get-VBRComputerBackupJobSession

Post by oleg.feoktistov »

Hi,

BackupStats data for agent management sessions is not written in task session object.
The closest option I could find is actually within CBackupSession class, but note that it is not supported for agent jobs anymore.
Example:

Code: Select all

$sessions = Get-VBRComputerBackupJobSession
$agentSession = [Veeam.Backup.Core.CBackupSession]::Find($sessions[1].Id)
$stats = $agentSession.AuxData | Select-Xml -XPath //AuxData/CBackupStats
$stats.Node
Thanks,
Oleg
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 13 guests