PowerShell script exchange
Post Reply
nanii-60
Influencer
Posts: 13
Liked: 1 time
Joined: Jan 17, 2019 10:09 am
Full Name: Fabien ROUSSILLON
Location: Paris, FRANCE
Contact:

VBREP doesn't work with new update

Post by nanii-60 »

Hello,

When I execute these powershell commands, nothing happens, yet I have configured some Windows Agent Backup jobs.
Image
Image

I have opened a case 03425869 but they say me that they don't provide any assistance with scripts...
Do you have an idea ?
Version 9.5 Update 4
Lucas_H
Influencer
Posts: 17
Liked: 4 times
Joined: Nov 16, 2018 3:14 pm
Full Name: Lucas HELLMANN
Location: Lyon, FRANCE
Contact:

Re: VBREP doesn't work with new update

Post by Lucas_H » 3 people like this post

Hello,

You can just use Get-VBRJob and it should display your Agent backup Job just fine.
Like this :

Code: Select all

asnp VeeamPSSnapin
$Job = Get-VBRJob | ? {$_.TypetoString -eq "Windows Agent Backup"}
$Job.Name
And as it is noted here : https://helpcenter.veeam.com/docs/backu ... l?ver=95u4 :
Veeam Agent for Microsoft Windows cmdlets will not work for jobs that were created using Veeam Agent management functionality. The ability to manage Veeam Agent management jobs will be provided in future versions of Veeam PowerShell.
You can't yet manage Agent Backup Job created via the B&R interfaces with the VBREP commands. It will only work with the Agent Backup Job created by the client server. if my understanding is correct.

Cheers,
Lucas
wishr
Veteran
Posts: 3077
Liked: 455 times
Joined: Aug 07, 2018 3:11 pm
Full Name: Fedor Maslov
Contact:

Re: VBREP doesn't work with new update

Post by wishr »

Hi Fabien,

The CMDlets you mentioned are designed for standalone Agent jobs backing up to B&R repository (notice the blue note in the article).

As of now, if you'd like to get information on Agent Management jobs, you may use the above suggestion by Lucas as a workaround.

Regards,
Fedor
nanii-60
Influencer
Posts: 13
Liked: 1 time
Joined: Jan 17, 2019 10:09 am
Full Name: Fabien ROUSSILLON
Location: Paris, FRANCE
Contact:

Re: VBREP doesn't work with new update

Post by nanii-60 »

Hello,
Thank you for your answer.
The goal is that i would like to modify this script :
https://gist.github.com/smasterson/9136468

Code: Select all

# Get all Agent Backup Jobs
$allJobsEp = @()
If ($showSummaryEp + $showJobsEp + $showAllSessEp + $showRunningEp +
  $showWarnFailEp + $showSuccessEp) {
  $allJobsEp = @(Get-VBREPJob)
}

Code: Select all

# Get all Agent Backup Sessions
$allSessEp = @()
If ($allJobsEp) {
  $allSessEp = Get-VBREPSession
}
So, i must replace Get-VBREPJob by Get-VBRJob | ? {$_.TypetoString -eq "Windows Agent Backup"}
But for agent backup sessions, i don't know how can i have results...
Lucas_H
Influencer
Posts: 17
Liked: 4 times
Joined: Nov 16, 2018 3:14 pm
Full Name: Lucas HELLMANN
Location: Lyon, FRANCE
Contact:

Re: VBREP doesn't work with new update

Post by Lucas_H »

Hello,

I am not sure you can do that, but you can give it a shot.
As another workaround, you can get Session info for Agent Backup Job this way :

Code: Select all

asnp VeeamPSSnapin
$jobs =  Get-VBRJob | ? {$_.TypetoString -eq "Windows Agent Backup"}
    ForEach ($job in $jobs) {$Session = $job.FindLastSession()
        $Session.Name
        $Session.CreationTime
        }
Name and Time are just two simples examples.
Maybe with some tweaking to the MyVeeamReport script you could get it working that way.

As far as I know, the Agent Backup Job managed with B&R has the same behavior as any "standard" Backup job, except for some parameters obviously :/
What exactly do you want to get from this script for your Agent Backup Job ?
There may be some script already existing here to get what you want.

Cheers,
Lucas
nanii-60
Influencer
Posts: 13
Liked: 1 time
Joined: Jan 17, 2019 10:09 am
Full Name: Fabien ROUSSILLON
Location: Paris, FRANCE
Contact:

Re: VBREP doesn't work with new update

Post by nanii-60 »

I have some jobs in VBR, each job send me a notification when it's finished, so I would like to have one report who summarize all jobs even Agent Backup Job...
Something like that http://jasonclarke.org/MVR951.html but more simplify
I just want to see a report with all job (VM and Agents), results, warnings, ... in a table as in the report

When I try it, it works, I have the result of the job agent.
$jobs = Get-VBRJob | ? {$_.TypetoString -eq "Windows Agent Backup"}
ForEach ($job in $jobs) {$Session = $job.FindLastSession()
$Session.Name
$Session.Result
}
But I don't arrive to integrate it into the script, do you know where could I modify it for that works ?
Zach123
Enthusiast
Posts: 40
Liked: 3 times
Joined: Jun 04, 2019 12:36 am
Full Name: zaki khan
Contact:

Re: VBREP doesn't work with new update

Post by Zach123 »

Hi

Just following up on the same old post. Has anyone being able to figure out a way to list all agent sessions.
Really need that as our existing report broke after the upgrade and no more showing agent tasks ( session ) .
wishr
Veteran
Posts: 3077
Liked: 455 times
Joined: Aug 07, 2018 3:11 pm
Full Name: Fedor Maslov
Contact:

Re: VBREP doesn't work with new update

Post by wishr »

Hello

Guys, just asking, have you ever considered to use Veeam ONE instead of PowerShell shamanism? :)
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: VBREP doesn't work with new update

Post by veremin »

Has anyone being able to figure out a way to list all agent sessions.
Can you tell me whether the workarounds given above work for you? Thanks!
Zach123
Enthusiast
Posts: 40
Liked: 3 times
Joined: Jun 04, 2019 12:36 am
Full Name: zaki khan
Contact:

Re: VBREP doesn't work with new update

Post by Zach123 »

Hi

if you are talking about this workaround.

Code: Select all

asnp VeeamPSSnapin
$jobs =  Get-VBRJob | ? {$_.TypetoString -eq "Windows Agent Backup"}
    ForEach ($job in $jobs) {$Session = $job.FindLastSession()
        $Session.Name
        $Session.CreationTime
        }
It just gets the last session information. There is no way you can get all the sessions for the VBR managed agent jobs using above workaround.
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: VBREP doesn't work with new update

Post by veremin »

May be this example can help:

Code: Select all

Asnp VeeamPSSnapin
$Jobs = Get-VBRJob | ? {$_.TypetoString -eq "Windows Agent Backup"}
ForEach ($job in $jobs) 
{
[Veeam.Backup.Core.CBackupSession]::GetByJob($Job.id)
}
Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests