PowerShell script exchange
Post Reply
Gunnersaurus
Influencer
Posts: 21
Liked: never
Joined: Aug 31, 2015 8:20 pm
Contact:

List all active Cloud Backup Copy jobs

Post by Gunnersaurus » Apr 26, 2017 4:43 am

Hi,

I'm trying to find the PowerShell command that will list all active Cloud Backup Copy jobs. I am able to see this from the Veeam console under Cloud Connect > Last 24 Hours > Running

Can someone please point me in the right direction? I've tried Get-VBRJob however I don't think this includes Cloud Connect jobs as it doesn't return any results.

Cheers!

Mike Resseler
Product Manager
Posts: 5841
Liked: 640 times
Joined: Feb 08, 2013 3:08 pm
Full Name: Mike Resseler
Location: Belgium
Contact:

Re: List all active Cloud Backup Copy jobs

Post by Mike Resseler » Apr 26, 2017 6:58 am

Hi Gunnersaurus,

Unfortunately I cannot test at this moment but I believe you should be looking into this direction:

Code: Select all

$Job = Get-VBRBackupSession #This returns all sessions for backup, backup copy job, replication and file copy jobs
$Job | ? {$_State -eq "Working"} | %{Write-Host $_.Name "-" $_.State}
The above should give you all sessions with a running state (or working).

Let me know
Mike

veremin
Product Manager
Posts: 17070
Liked: 1475 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: List all active Cloud Backup Copy jobs

Post by veremin » Apr 26, 2017 6:50 pm

The following one-liner should answer your requirements:

Code: Select all

Get-VBRJob | where {$_.Jobtype -eq "BackupSync" -and $_.isCloudTargetJob() -eq $True -and $_.GetLastState() -eq "Running"} | select name
Thanks.

Gunnersaurus
Influencer
Posts: 21
Liked: never
Joined: Aug 31, 2015 8:20 pm
Contact:

Re: List all active Cloud Backup Copy jobs

Post by Gunnersaurus » Apr 26, 2017 7:40 pm

I have tried both solutions however neither return any results. I should mention that I am attempting to run this on the destination Cloud Connect Veeam server which has the console installed. In other words, tenant Backup Copy jobs are being received on the server that I am trying to run the command from.

Mike Resseler
Product Manager
Posts: 5841
Liked: 640 times
Joined: Feb 08, 2013 3:08 pm
Full Name: Mike Resseler
Location: Belgium
Contact:

Re: List all active Cloud Backup Copy jobs

Post by Mike Resseler » Apr 27, 2017 5:45 am

Hi Gunnersaurus,

Could you run it without the ?. So:

Code: Select all

$Job = Get-VBRBackupSession 
$Job | %{Write-Host $_.Name "-" $_.State}
This will give you the entire list and you should be able to see everything and the state and see what that returns?

Mike Resseler
Product Manager
Posts: 5841
Liked: 640 times
Joined: Feb 08, 2013 3:08 pm
Full Name: Mike Resseler
Location: Belgium
Contact:

Re: List all active Cloud Backup Copy jobs

Post by Mike Resseler » Apr 27, 2017 5:51 am

Or the oneliner of Vova but remove the last query

Code: Select all

Get-VBRJob | where {$_.Jobtype -eq "BackupSync" -and $_.isCloudTargetJob() -eq $True} | select name, state

veremin
Product Manager
Posts: 17070
Liked: 1475 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: List all active Cloud Backup Copy jobs

Post by veremin » Apr 27, 2017 9:21 am

In other words, tenant Backup Copy jobs are being received on the server that I am trying to run the command from.
Ah, tenants' backup copy jobs are not returned by PowerShell queries executed on SP's backup console. Feel free to leverage Veeam ONE Free that should have reports you're looking for. Thanks.

Gunnersaurus
Influencer
Posts: 21
Liked: never
Joined: Aug 31, 2015 8:20 pm
Contact:

Re: List all active Cloud Backup Copy jobs

Post by Gunnersaurus » Apr 30, 2017 9:44 pm

v.Eremin wrote:Ah, tenants' backup copy jobs are not returned by PowerShell queries executed on SP's backup console. Feel free to leverage Veeam ONE Free that should have reports you're looking for. Thanks.
Will using Veeam ONE still allow me use that informatoin in a PowerShell script?

Basically, I want to temporarily disable a tenants account but before doing so, I need to make sure no Backup Copy Jobs are running to the MSP backup repository.

veremin
Product Manager
Posts: 17070
Liked: 1475 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: List all active Cloud Backup Copy jobs

Post by veremin » May 01, 2017 10:07 am

Veeam ONE does not expose information through PowerShell. As to disabling inactive tenants, have you thought about leveraging LastActive parameter of Tenant object? Make script check the said parameter and disable an account, if last activity happened, say, more than 30 minutes ago.

Gunnersaurus
Influencer
Posts: 21
Liked: never
Joined: Aug 31, 2015 8:20 pm
Contact:

Re: List all active Cloud Backup Copy jobs

Post by Gunnersaurus » May 01, 2017 11:31 pm

I had a look at LastActive however for customers where the console shows an active backup, it shows LastActive as either a few hours ago or 1/01/1900.

StigSornsen
Novice
Posts: 8
Liked: 1 time
Joined: Nov 17, 2016 2:39 pm
Full Name: Stig Sörnsen
Contact:

[MERGED] Last 24 hours in Powershell?

Post by StigSornsen » Jun 19, 2017 12:21 pm

Hi, I would like to get the "Last 24 hours" view in Cloud Connect through Powershell.
But I can't see how to do that?

In Powershell regarding Cloud Connect I can only do the same as the in built Report shows. But the "Last 24 hours" view is quite useful to see if everything has worked as intended an also see which objects has failed if so.

Any help getting that useful info?

veremin
Product Manager
Posts: 17070
Liked: 1475 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: List all active Cloud Backup Copy jobs

Post by veremin » Jun 19, 2017 12:38 pm 1 person likes this post

The information you're looking for currently is not exposed via PowerShell. Have you checked Veeam ONE Cloud Connect free report pack?

StigSornsen
Novice
Posts: 8
Liked: 1 time
Joined: Nov 17, 2016 2:39 pm
Full Name: Stig Sörnsen
Contact:

Re: List all active Cloud Backup Copy jobs

Post by StigSornsen » Jun 19, 2017 12:59 pm

v.Eremin wrote:The information you're looking for currently is not exposed via PowerShell. Have you checked Veeam ONE Cloud Connect free report pack?

Hi Eremin, thank you for quick reply. Do you know how I can find that information in database? I have gone through alot of tables but haven't found it yet.

StigSornsen
Novice
Posts: 8
Liked: 1 time
Joined: Nov 17, 2016 2:39 pm
Full Name: Stig Sörnsen
Contact:

Re: List all active Cloud Backup Copy jobs

Post by StigSornsen » Jun 19, 2017 1:17 pm 1 person likes this post

Found it with a profiler:

Code: Select all

SELECT  *  FROM ReportCloudFilteredSessionsView WITH (readuncommitted, nolock) WHERE (([end_time]  >  '2017-06-18T15:02:13' or [end_time]  =  '1900-01-01T00:00:00')) AND (([session_type]  =  '1' or ([session_type]  =  '2' or ([session_type]  =  '4' or [session_type]  =  '6')))) AND (not (([session_type]  =  '2' and ([productId]  =  '{819A7952-2B80-4287-A99A-79DD0578E5AD}' or [productId]  =  '{2C9E3B09-F27C-4E27-8A8E-CFEF030041F2}')))) AND (([end_time]  >  '2017-06-18T15:02:13' or [end_time]  =  '1900-01-01T00:00:00')) AND ([usn]  >  '0')  ORDER BY creation_time  desc

This give me exactly what I want. Though I would love to be able to do this with Powershell natively :)

veremin
Product Manager
Posts: 17070
Liked: 1475 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: List all active Cloud Backup Copy jobs

Post by veremin » Jun 19, 2017 1:52 pm

Your voice has been heard, we will see what we can add for this matter in future product releases. By the way, great workaround!

sgarcianf
Service Provider
Posts: 2
Liked: never
Joined: Feb 23, 2018 7:47 pm
Full Name: Steven Garcia
Contact:

Re: List all active Cloud Backup Copy jobs

Post by sgarcianf » May 30, 2018 6:41 pm

v.Eremin.. clearly he is looking for a programmatic means to work around tenant jobs but you keep pushing veeam one reporter? This is not helpful. What is helpful is a way to insert this request into a voting list or some means by which we as Veeam SPs can input our needs as stakeholders.

veremin
Product Manager
Posts: 17070
Liked: 1475 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: List all active Cloud Backup Copy jobs

Post by veremin » Jun 01, 2018 3:25 pm

I'm not trying to push anything, it's more about me suggesting existing solution that answers OP's requirements.

If Veeam ONE is not something you'd like to stick with, then, there is a programmatic workaround given on a previous page.

Anyway, consider your vote for PS enhancement counted.

Thanks.

christophe.niel.AID
Novice
Posts: 7
Liked: never
Joined: Jul 25, 2019 1:11 pm
Full Name: Christophe Niel
Contact:

[MERGED] List running jobs/session in Cloud Connect replicas

Post by christophe.niel.AID » Jul 25, 2019 1:26 pm

Hello
I'm hosting a cloud connect with multiple tenants, one gateway a few dozen replicas

I'm trying to get the running replicas jobs (or more precisely the ones named "Cloud Backup Copy" in the Session Type)

my goal is to know when there are no active replication to do a bit of maintenance and cleanup on my proxies as I have a bug where the disks are staying mounted on the proxies and that is causing a lot of problems. this is not the issue of this post, ticket are already opened.

my problem is I can't seem to find active session for Jobs I don't have (they setup in my tenant server I don't see), and I could find a command in powershell Cloud Connect API to get active sessions.

Is there a way to get the running sessions in a command line (not powershell would be ok) ?
if there are no way to get it now, is it planned some time in the future?

thanks in advance
Christophe Niel

billcouper
Service Provider
Posts: 68
Liked: 18 times
Joined: Dec 18, 2017 8:58 am
Full Name: Bill Couper
Contact:

Re: List running jobs/session in Cloud Connect replicas

Post by billcouper » Jul 27, 2019 6:51 am

Don't do cloud connect replicas here, but if it works similar to cloud connect backups the 'last active date' is set to 1/1/1900 when it's running

christophe.niel.AID
Novice
Posts: 7
Liked: never
Joined: Jul 25, 2019 1:11 pm
Full Name: Christophe Niel
Contact:

Re: List running jobs/session in Cloud Connect replicas

Post by christophe.niel.AID » Jul 29, 2019 8:04 am

Hi, thanks for your response

My problem is I can't even list the jobs or sessions from the veaam cloud connect.
I can get normal veeam B&R job and session.

What do you use as a command to event list the jobs?

Thanks in advance

christophe.niel.AID
Novice
Posts: 7
Liked: never
Joined: Jul 25, 2019 1:11 pm
Full Name: Christophe Niel
Contact:

Re: List running jobs/session in Cloud Connect replicas

Post by christophe.niel.AID » Jul 29, 2019 12:10 pm

ah, I can't edit a post

maybe I should insist on the fact I am on the Service Provider (SP) side, not the Client side.

veremin
Product Manager
Posts: 17070
Liked: 1475 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: List all active Cloud Backup Copy jobs

Post by veremin » Jul 29, 2019 4:48 pm

This information is not available in PS or REST. You can use Veeam ONE free report pack, though. Thanks!

christophe.niel.AID
Novice
Posts: 7
Liked: never
Joined: Jul 25, 2019 1:11 pm
Full Name: Christophe Niel
Contact:

Re: List all active Cloud Backup Copy jobs

Post by christophe.niel.AID » Jul 29, 2019 5:06 pm

Thanks for your answer, but that is not a valid (acceptable) answer but I'll contact support from now on, even with the B&R admin console I don't even know which resources (ie: MY proxies) are being used by the clients..

I'm setting up a cloud with automation and bots, and I'm not sure if I need a software that must to have an UI and a human to read the output to make our cloud working.

veremin
Product Manager
Posts: 17070
Liked: 1475 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: List all active Cloud Backup Copy jobs

Post by veremin » Jul 29, 2019 5:23 pm

I'm not sure that support team will help you with this issue. The can log feature request, sure, but you've done exactly that by posting your query here.

For now you can try db approach mentioned above or CC reports available in Veeam ONE.

Thanks; consider your vote counted!

christophe.niel.AID
Novice
Posts: 7
Liked: never
Joined: Jul 25, 2019 1:11 pm
Full Name: Christophe Niel
Contact:

Re: List all active Cloud Backup Copy jobs

Post by christophe.niel.AID » Jul 29, 2019 5:29 pm

Thanks for your answer
Yes i was hoping to ask for a feature request to support, didn't know posting here would help for this.
I'll look into the db in the next days, if I find something I'll post it
Veeamone is not in my scope, I'll check with the team.

Best regards

veremin
Product Manager
Posts: 17070
Liked: 1475 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: List all active Cloud Backup Copy jobs

Post by veremin » Jul 29, 2019 5:56 pm

Since you're a Cloud Connect Provider, then, Veeam ONE (or its Cloud Connect report features) are available for you free. So, might be worth checking. Thanks!

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests