List all active Cloud Backup Copy jobs

PowerShell script exchange

List all active Cloud Backup Copy jobs

Veeam Logoby Gunnersaurus » Wed 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!
Gunnersaurus
Influencer
 
Posts: 19
Liked: never
Joined: Mon Aug 31, 2015 8:20 pm

Re: List all active Cloud Backup Copy jobs

Veeam Logoby Mike Resseler » Wed 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
Mike Resseler
Veeam Software
 
Posts: 3498
Liked: 390 times
Joined: Fri Feb 08, 2013 3:08 pm
Location: Belgium, the land of the fries, the beer, the chocolate and the diamonds...
Full Name: Mike Resseler

Re: List all active Cloud Backup Copy jobs

Veeam Logoby v.Eremin » Wed 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.
v.Eremin
Veeam Software
 
Posts: 13868
Liked: 1038 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: List all active Cloud Backup Copy jobs

Veeam Logoby Gunnersaurus » Wed 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.
Gunnersaurus
Influencer
 
Posts: 19
Liked: never
Joined: Mon Aug 31, 2015 8:20 pm

Re: List all active Cloud Backup Copy jobs

Veeam Logoby Mike Resseler » Thu 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
Veeam Software
 
Posts: 3498
Liked: 390 times
Joined: Fri Feb 08, 2013 3:08 pm
Location: Belgium, the land of the fries, the beer, the chocolate and the diamonds...
Full Name: Mike Resseler

Re: List all active Cloud Backup Copy jobs

Veeam Logoby Mike Resseler » Thu 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
Mike Resseler
Veeam Software
 
Posts: 3498
Liked: 390 times
Joined: Fri Feb 08, 2013 3:08 pm
Location: Belgium, the land of the fries, the beer, the chocolate and the diamonds...
Full Name: Mike Resseler

Re: List all active Cloud Backup Copy jobs

Veeam Logoby v.Eremin » Thu 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.
v.Eremin
Veeam Software
 
Posts: 13868
Liked: 1038 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: List all active Cloud Backup Copy jobs

Veeam Logoby Gunnersaurus » Sun 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.
Gunnersaurus
Influencer
 
Posts: 19
Liked: never
Joined: Mon Aug 31, 2015 8:20 pm

Re: List all active Cloud Backup Copy jobs

Veeam Logoby v.Eremin » Mon 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.
v.Eremin
Veeam Software
 
Posts: 13868
Liked: 1038 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: List all active Cloud Backup Copy jobs

Veeam Logoby Gunnersaurus » Mon 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.
Gunnersaurus
Influencer
 
Posts: 19
Liked: never
Joined: Mon Aug 31, 2015 8:20 pm

[MERGED] Last 24 hours in Powershell?

Veeam Logoby StigSornsen » Mon 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?
StigSornsen
Novice
 
Posts: 8
Liked: 1 time
Joined: Thu Nov 17, 2016 2:39 pm
Full Name: Stig Sörnsen

Re: List all active Cloud Backup Copy jobs

Veeam Logoby v.Eremin » Mon 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?
v.Eremin
Veeam Software
 
Posts: 13868
Liked: 1038 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: List all active Cloud Backup Copy jobs

Veeam Logoby StigSornsen » Mon 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: Thu Nov 17, 2016 2:39 pm
Full Name: Stig Sörnsen

Re: List all active Cloud Backup Copy jobs

Veeam Logoby StigSornsen » Mon 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 :)
StigSornsen
Novice
 
Posts: 8
Liked: 1 time
Joined: Thu Nov 17, 2016 2:39 pm
Full Name: Stig Sörnsen

Re: List all active Cloud Backup Copy jobs

Veeam Logoby v.Eremin » Mon 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!
v.Eremin
Veeam Software
 
Posts: 13868
Liked: 1038 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 1 guest