Skip to main content

Hi All,

 

I need a Veeam powershell command to fetch agent based backup.

 

I am using below command to fetch last night backup status but it doesn’t include agent based backup.

 

Get-VBRBackupSession | Where-Object {$_.JobType -eq "Backup" -and $_.EndTime -ge (Get-Date).addhours(-24)}

 

Do you know single command to fetch all types of backup or different command for agent based backup?

 

Thanks in advance

Try using $.JobType -eq “EpAgentBackup”

But this deprecated as far as I know, have a look at the Get-VBRComputerBackupJob cmdlet.


Hi @Surya 

this for Agent - Returns backup jobs run by Veeam Agent operating in a standalone mode.

Get-VBREPJob - Veeam Backup PowerShell Reference

 

This for managed Agent:

Get-VBRComputerBackupJob - Veeam Backup PowerShell Reference

 


Try using $.JobType -eq “EpAgentBackup”

But this deprecated as far as I know, have a look at the Get-VBRComputerBackupJob cmdlet.

Thanks

Get-VBRComputerBackupJob is working. Can I segregate the each client backup statistics?
 

i need details "Name","Jobname","Status","StartTime","EndTime","TransferedSizeinMB"


Hi @Surya 

this for Agent - Returns backup jobs run by Veeam Agent operating in a standalone mode.

Get-VBREPJob - Veeam Backup PowerShell Reference

 

This for managed Agent:

Get-VBRComputerBackupJob - Veeam Backup PowerShell Reference

 

Thanks

Get-VBRComputerBackupJob is working. Can I fetch the each client backup statistics?
 

i need details "Name","Jobname","Status","StartTime","EndTime","TransferedSizeinMB"


Try using $.JobType -eq “EpAgentBackup”

But this deprecated as far as I know, have a look at the Get-VBRComputerBackupJob cmdlet.

Thanks

Get-VBRComputerBackupJob is working. Can I segregate the each client backup statistics?
 

i need details "Name","Jobname","Status","StartTime","EndTime","TransferedSizeinMB"

You can do this with
Get-VBRComputerBackupJoB | select Name,Jobname,Status,StartTime,EndTime,TransferedSizeinMB


Try using $.JobType -eq “EpAgentBackup”

But this deprecated as far as I know, have a look at the Get-VBRComputerBackupJob cmdlet.

Thanks

Get-VBRComputerBackupJob is working. Can I segregate the each client backup statistics?
 

i need details "Name","Jobname","Status","StartTime","EndTime","TransferedSizeinMB"

You can do this with
Get-VBRComputerBackupJoB | select Name,Jobname,Status,StartTime,EndTime,TransferedSizeinMB

Thanks for your reply

 

it doesnt get me each client backup statistics ( null value is printed on Status, StartTime,EndTime,Size).

I have used below queries for VM backup status.

# Fetch each backup job sessions from VBR for the last 24 hours
$vbrsessions = Get-VBRBackupSession | Where-Object {$_.JobType -eq "Backup" -and $_.EndTime -ge (Get-Date).addhours(-24)}

# Fetch each client session details from each backup job
$client = foreach ($session in $vbrsessions) {$session.gettasksessions()| Select Name, Jobname, Status, @{n='StartTime';e={$_.Progress.StartTimeLocal}}, @{n='EndTime';e={$_.Progress.StopTimeLocal}},@{n='TransferedSizeinMB';e={Mmath]::Round(($_.Progress.TransferedSize/1048576),2)}}}
 

 

Can i get similar one for agent based backup?


Yes, you can.

Try get-vbrcomputerjobsession

https://helpcenter.veeam.com/docs/backup/powershell/get-vbrcomputerbackupjobsession.html?ver=110

 

Then you get something like this:

CreationTime : 18.02.2022 04:30:13

EndTime      : 18.02.2022 04:40:59

JobId        : c1de222e-382d-487d-b42e-8fc991bd8d11

Result       : Success

State        : Stopped

Id           : 32d9bec6-e679-4bc6-b9e2-b06dc6961700

CreationTime : 17.02.2022 14:05:52

EndTime      : 17.02.2022 14:16:59

JobId        : c1de222e-382d-487d-b42e-8fc991bd8d11

Result       : Success

State        : Stopped

Id           : 8f3fe24e-50cb-4986-a6e7-b30e61af258a

 

It is not completely what you want, but it is a beginning….


 

Thanks for all your responses.

 

Get-VBRComputerBackupJoB is only fetching job status. I haven’t each and every client in that job.

 

Can you please help me to fetch each client’s backups status?


Hi,
please try this script:

$job = Get-VBRComputerBackupJob -Name 'Agent Backup Job'
$sessions = Get-VBRComputerBackupJobSession -Name "$($job.Name)?*"
foreach ($session in $sessions) {
Get-VBRTaskSession -Session $session
}

This gets you the name of the backed up system and the status.  You can get more information from each session, please experiment a little bit with this to get the specific information you need. 😃

 


 

I have developed below script by God’s grace and it worked for me

 

 

$job =Get-VBRComputerBackupJob
foreach ($sessions in $job) 

$jname = Get-VBRComputerBackupJobSession -Name "$($sessions.Name)?*"
$jname1=$jname| where-object {$_.EndTime -ge (Get-Date).addhours(-24)}
foreach ($session in $jname1) 
{
Get-VBRTaskSession -Session $session| Select-Object -Property Name,@{n='Jobname';e= {$($sessions.Name)}},status,@{n='StartTime';e={$_.Progress.StartTimeLocal}}, @{n='EndTime';e={$_.Progress.StopTimeLocal}},@{n='TransferedSizeinMB';e={nmath]::Round(($_.Progress.TransferedSize/1048576),2)}}
}
}

 

 

Thanks all for your support


Can you please help me to fetch each client’s backups failed status?


 

Below script will fetch you the failed clients in last 24 hours 

 

(it will work for VM not for plugin & agent based. If you need that also, let me know)

 

$vbrsessions = Get-VBRBackupSession | Where-Object {$_.JobType -eq "Backup" -and $_.EndTime -ge (Get-Date).addhours(-24)}

$client = foreach ($session in $vbrsessions) {$session.gettasksessions()|Where-Object {$_.Status -eq "Failed"}| Select Name, Jobname, Status, @{n='StartTime';e={$_.Progress.StartTimeLocal}}, @{n='EndTime';e={$_.Progress.StopTimeLocal}},@{n='TransferedSizeinMB';e={;math]::Round(($_.Progress.TransferedSize/1048576),2)}}}


Hi guys,

I saw that this forum was closed two years ago, but I'm having a problem searching for information in jobs type "EpAgentBackup", in the "Backup" type I can search for all the information, but in "EpAgentBackup" I can't...

I would like to obtain information as below:

 

               Job                          = $JobName

                Name                      = $jobObject.Name

                Size                         = $jobObject.ApproxSizeString

                PointsOnDisk            = $PointsOnDisk

                LastResult                = $LastResult

                LastBackupStart        = $LastBackupStart

                LastBackupTotalSize  = $BackupTotalSize

                LastBackupSize         = $BackupSize

                RepositoryPath         = $RepositoryPath

                Status                     = $jobStatus

 

Today I can't search for information via PowerShell in Agent type jobs.

Could someone please tell me if it is possible?


Thanks in advance

Thank you for all your support!


Comment