I got the following script which is working well
Code: Select all
$now = Get-Date -Format dd-MM-yyyy_HH-mm
$results_array = @()
$jobs = Get-VBRJob | Where-Object {$_.IsBackup}
ForEach ($job in $jobs) {
$lastsession = $job.FindLastSession()
foreach ($tasksession in $lastsession.GetTaskSessions()) {
$objResult = [pscustomobject][ordered]@{
Job = $job.Name
Status = $job.GetLastResult()
BackupMethod = $job.Options.BackupTargetOptions.Algorithm -replace "Syntethic","Reversed"
RestorePoints = $job.Options.BackupStorageOptions.RetainCycles
PointsOnDisk = (get-vbrbackup -Name $job.Name | Get-VBRRestorePoint -Name $tasksession.Name | Measure-Object).Count
ProxyName = If ($job.SourceProxyAutoDetect -eq $True) {"Automatic proxy selection is enabled."} else {($job | Get-VBRJobProxy).name}
}
$results_array += $objResult
}
}
#Export to CSV file
$CSVreportfilename = "E:\Viatek\Veeam_Scripts\Veeam-daily-Report-" + $now + ".csv"
$results_array | Sort-Object Server, JobName, VmName | Export-CSV $CSVreportfilename -NoTypeInformation
could you please help ?
cheers
Ian