PowerShell script exchange
Post Reply
Filippo1975
Service Provider
Posts: 30
Liked: never
Joined: May 11, 2018 3:23 pm
Full Name: Filippo M
Contact:

Getting CloudConnect sessions

Post by Filippo1975 »

Hello,
we would like to know if is possible to get in a certain moment the cloud connect session via powershell, in order to activate a triggered alarm.
I've search in the previous posts and it seeems not directly embeded in cloud connect powershell cmdlet.. may be it's possibile via database query.
Can somebody help us ?
david.domask
Product Manager
Posts: 3379
Liked: 797 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Getting CloudConnect sessions

Post by david.domask »

Hi Filippo1975,

Can you specify which session you're specifically wanting to poll with powershell?

Get-VBRSession has the -Type parameter and we have several cloud session types possible, but I'm not positive that's what you're looking for. Can you share a screenshot of the session in the UI you want to report on?
David Domask | Product Management: Principal Analyst
Filippo1975
Service Provider
Posts: 30
Liked: never
Joined: May 11, 2018 3:23 pm
Full Name: Filippo M
Contact:

Re: Getting CloudConnect sessions

Post by Filippo1975 »

Hi David,
we just need to get the running session on the cloud connect... if I type on powershell session the command "Get-VBRSession -Type cloud" it seems to be hang... I 've found this in a previous post..
[Veeam.Backup.Core.CBaseSession]::GetRunning()

but i don't know why sometimes it works successfully sometimes the command is not recognized...
david.domask
Product Manager
Posts: 3379
Liked: 797 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Getting CloudConnect sessions

Post by david.domask »

Got it, I think I know what you're going for, and regrettably there are no supported cmdlets for this at this time.

> [Veeam.Backup.Core.CBaseSession]::GetRunning()

This is an unsupported method, but it will be the way you need to go. This is .NET Reflection, and to properly "prime" the powershell session for using .NET Reflection, you must first run a normal cmdlet to load the DLLs.

Get-VBRLicenseAutoUpdateStatus | Out-Null
[Veeam.Backup.Core.CBaseSession]::GetRunning()

Is a winning combo and will always work. Any "real" cmdlet is suitable, but Get-VBRLicenseAutoUpdateStatus is quick cmdlet, no chance to break anything, and you can just bin the output into Out-Null to avoid useless data in the shell/script output.
David Domask | Product Management: Principal Analyst
Matt.Sharpe
Service Provider
Posts: 243
Liked: 20 times
Joined: Mar 29, 2016 3:37 pm
Full Name: Matt Sharpe
Contact:

Re: Getting CloudConnect sessions

Post by Matt.Sharpe »

Do you know if there is a combination to stop specific sessions via this query?
david.domask
Product Manager
Posts: 3379
Liked: 797 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Getting CloudConnect sessions

Post by david.domask »

Hi Matt,

Unsupported methods should only be used for reporting purposes so I cannot advise using the above unsupported methods for any management tasks.

Can you elaborate more on the workflow you're trying to accomplish? You want to run these on the Cloud Connect server or on the tenant side?

Just perhaps there's a supported means of doing what you're trying to do, so please clarify the workflow you're wanting to achieve.
David Domask | Product Management: Principal Analyst
masonit
Service Provider
Posts: 336
Liked: 23 times
Joined: Oct 09, 2012 2:30 pm
Full Name: Maso
Contact:

Re: Getting CloudConnect sessions

Post by masonit »

I am trying to collect all all cc sessions from sp cc. I tried [Veeam.Backup.Core.CBaseSession]::GetRunning() and it works. But it is only collecting running sessions. How can I collect all sessions? I tried Get-VBRSession -Type Cloud. It works but I get only limited data. I am looking for performance data, like data sent and more.

\M
david.domask
Product Manager
Posts: 3379
Liked: 797 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Getting CloudConnect sessions

Post by david.domask »

Hi masonit,

Unfortunately we will need to go to unsupported methods here.

Code: Select all

$exclSess = 'Auxiliary session','Console','DbAccessor','RepositorySpaceSync'
$liteSess = Get-VBRSession -Type Cloud | Where-Object {$_.Name -notin $exclSess}
$allSess = @()
Foreach($l in $liteSess){
	$data = [Veeam.Backup.Core.CCloudSession]::Find($l.id)
	$allSess += $data
	Remove-Variable data
}
$allSess will be populated with the full session data from the Cloud Connect server. Keep in mind, the code as written will return ALL SESSIONS from the Cloud Connect server, so you will probably want to filter when running Get-VBRSession on the CreationTime parameter to set an earliest date you want to collect from.

If you have many sessions (tens of thousands), you may consider using a generic list instead of a normal array:

Code: Select all

$allSess = [System.Collections.Generic.list[object]]@()
...
$allSess.Add($data)
It will be much faster for large datasets.
David Domask | Product Management: Principal Analyst
masonit
Service Provider
Posts: 336
Liked: 23 times
Joined: Oct 09, 2012 2:30 pm
Full Name: Maso
Contact:

Re: Getting CloudConnect sessions

Post by masonit »

Thanks!

I almost get the data I need. I am trying to get "progress" data. "Data received", but I am not able to find that. Is this possible?

\M
david.domask
Product Manager
Posts: 3379
Liked: 797 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Getting CloudConnect sessions

Post by david.domask »

You're welcome.

Regrettably, the data sent / received doesn't seem to be stored on the same objects, and I'm not aware of any means (supported or unsupported) for fetching that data at this time.

Edit: Looks like this is handled pretty differently and not accessible even with unsupported methods, so regrettably we will not be able to get the Data Sent / Received statistics from Veeam's Powershell module)
David Domask | Product Management: Principal Analyst
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests