Skip to main content
Solved

Powershell for getting members of Physical Infrastructure

  • March 27, 2024
  • 2 comments
  • 94 views

I have a pretty simple request that I just can’t seem to identify the correct command for.

I’m just looking to be able to query what job a system is a member of. It’s very easy to do for any virtual systems, but harder for physical. Connecting and getting the job are easy. And the $Job.BackupObject property contains the Physical Infrastructure object I’m interested in, but not the actual members of the Physical Infrastructure box.

The script:

The Physical Infrastructure Object:


The contents I’m really trying to get:
 

 

Best answer by damien commenge

Hello,

 

This is what I use :

function Get-VeeamProtectionGroupComputers
{
Write-Host "$(Get-Date -Format HH:mm:ss) - Protections Groups Computers view"
$ProtectionGroupsReq = Get-VBRProtectionGroup
foreach ($ProtectionGroup in $ProtectionGroupsReq)
{
$computers = Get-VBRDiscoveredComputer -ProtectionGroup $ProtectionGroup
foreach ($computer in $computers)
{
$CBTDriverVersion = $computer.DriverVersion
[pscustomobject]@{
Name = $ProtectionGroup.name
Computer = $computer.name
AgentVersion = $computer.AgentVersion
IP = $computer.IPAddress.IPAddressToString
AgentStatus = $computer.AgentStatus
Driver = $computer.DriverStatus
CBTVersion = if($null -ne $CBTDriverVersion) {$CBTDriverVersion} else {"<N/A>"}
LastConnected = $computer.LastConnected
}
}
}
Write-host "$(Get-Date -Format HH:mm:ss) --------------------"
}

 

2 comments

  • Author
  • Not a newbie anymore
  • March 27, 2024

Thanks for any help in advance!


damien commenge
Forum|alt.badge.img+5

Hello,

 

This is what I use :

function Get-VeeamProtectionGroupComputers
{
Write-Host "$(Get-Date -Format HH:mm:ss) - Protections Groups Computers view"
$ProtectionGroupsReq = Get-VBRProtectionGroup
foreach ($ProtectionGroup in $ProtectionGroupsReq)
{
$computers = Get-VBRDiscoveredComputer -ProtectionGroup $ProtectionGroup
foreach ($computer in $computers)
{
$CBTDriverVersion = $computer.DriverVersion
[pscustomobject]@{
Name = $ProtectionGroup.name
Computer = $computer.name
AgentVersion = $computer.AgentVersion
IP = $computer.IPAddress.IPAddressToString
AgentStatus = $computer.AgentStatus
Driver = $computer.DriverStatus
CBTVersion = if($null -ne $CBTDriverVersion) {$CBTDriverVersion} else {"<N/A>"}
LastConnected = $computer.LastConnected
}
}
}
Write-host "$(Get-Date -Format HH:mm:ss) --------------------"
}