I'm trying to pull up backup size for Windows Agent servers with Powershell for last 4 weeks, and show ZERO byte for size of app, read and transferred
Output:
Code: Select all
Name : XXXXX
Status : Success
StartTime : 10/2/2022 3:00:14 AM
EndTime : 10/2/2022 3:00:15 AM
Size : 0
Read : 0
Transferred : 0
Duration : 00:00:01
Code: Select all
$jobs = Get-VBRComputerBackupJob | where {$_.name -eq "XXXXXX"}
$taskSessions = @()
$g5 = Get-VBRComputerBackupJobSession
$sessions = $g5 | where {($_.JobId -eq $jobs.id) -and( ($_.CreationTime -ge [datetime]::parseexact($convertday, 'dd-MMM-yy', $null) -and $_.CreationTime -le [datetime]::parseexact($convertday2, 'dd-MMM-yy', $null)))}
foreach ($session in $sessions) {
$tasks = Get-VBRTaskSession -Session $session
$taskSessions += $tasks
}
$taskSessions | select Name, Status, @{n='StartTime';e={$_.Info.Progress.StartTimeUtc}}, `
@{n='EndTime';e={$_.Info.Progress.StopTimeUtc}}, @{n='Size';e={$_.Info.Progress.TotalSize}}, `
@{n='Read';e={$_.Info.Progress.ReadSize}}, `
@{n='Transferred';e={$_.Info.Progress.TransferedSize}}, @{n='Duration';e={$_.Info.Progress.Duration.ToString()}}
}