Skip to main content
Question

VBR module failed to fetch all client(Servers) from backup


VBR module unable to fetch complete list of servers(clients) from a backup job. As some physical server backup job ids are not getting populated even it’s taken the backup.

 

4 comments

Chris.Childerhose
Forum|alt.badge.img+21

Can you post the script or script line you are trying to run that is not giving you the results?  Also what version of Veeam are you using.  We need more context as  nothing mentioned explains the problem.


  • Author
  • New Here
  • 2 comments
  • July 3, 2024

#Load the Veeam PSSnapin
Get-PSSnapin -Name VeeamPSSnapIn -ErrorAction SilentlyContinue
      Add-PSSnapin -Name VeeamPSSnapIn -ErrorAction SilentlyContinue
      Connect-VBRServer -ErrorAction SilentlyContinue

       $AllJobs = Get-VBRJob -WarningAction SilentlyContinue 

    $VMwareBackupJobIDs = $AllJobs | Where-Object { ($_.isbackupcopy -eq $false) } | Select-Object -ExpandProperty ID 
$Date=(get-date).AddDays(-1) 
    $AllBackupSessions = [Veeam.Backup.Core.CBackupSession]::GetAll()
    $SelectBackupSessions = $AllBackupSessions | Where-Object { $_.JobId -in $VMwareBackupJobIDs -and $_.CreationTime -gt $date }

    $SelectTaskSessions = $SelectBackupSessions.GetTaskSessions()

 

    $FilteredSelectTaskSessions = $SelectTaskSessions

 

    $TaskOutputResult=@()
    foreach ($TaskSession in $FilteredSelectTaskSessions) {

       $TaskOutputResult+= [pscustomobject][ordered] @{

        'JobName'           = $TaskSession.JobName
        'VMName'            = $TaskSession.Name
        'Status'            = $TaskSession.Status
        'IsRetry'           = $TaskSession.JobSess.IsRetryMode
        'CreationTime'      = $TaskSession.JobSess.CreationTime
        }
          }

 

      
      return $TaskOutputResult
          }

 

 

In $AllBackupSessions we are not getting the list of IDs for physical backups . Could you please check and confirm if any bug in the script . Except physical bacckup client list Im able to fetch all data .


Forum|alt.badge.img+3
  • Comes here often
  • 112 comments
  • July 8, 2024
   $VMwareBackupJobIDs = $AllJobs | Where-Object { ($_.isbackupcopy -eq $false) } | Select-Object -ExpandProperty ID 
$Date=(get-date).AddDays(-1) 
    $AllBackupSessions = [Veeam.Backup.Core.CBackupSession]::GetAll()
    $SelectBackupSessions = $AllBackupSessions | Where-Object { $_.JobId -in $VMwareBackupJobIDs -and $_.CreationTime -gt $date }

These are likely the problematic lines.

First, please note that .NET reflection and .NET methods are not supported; please see this post for more information: https://forums.veeam.com/post477483.html#p477483

To get Agent backup sessions, please use:

Get-VBRComputerBackupJobSession

Get the Id from the results and pass it to Get-VBRBackupSession on the -Id parameter.

That will return a proper and legal session object.

Pass the CBackupSession object from Get-VBRBackupSession to Get-VBRTaskSession on the -Session parameter, and that will return the Task sessions, which should have the necessary information you need for agent backup jobs/sessions.


  • Author
  • New Here
  • 2 comments
  • July 8, 2024

Let me check and confirm here