PowerShell script exchange
Post Reply
JMeixner
Veeam Legend
Posts: 6
Liked: 1 time
Joined: Apr 20, 2021 3:16 pm
Full Name: Jochen (Joe) Meixner
Contact:

List RMAN Plugin Session with Powershell

Post by JMeixner »

Hello,
I am trying to get a list of the RMAN plugin sessions with Powershell.
The Plugin jobs can be listed with get-VBRPluginJob, but I would like to get the sigle sessions as they are shown in the Veeam console in the "Last 24 Hours" list or in the History tab.

Is there a solution for this? I didn't find a suitable Veeam Powewrshell cmdlet...
oleg.feoktistov
Veeam Software
Posts: 1912
Liked: 635 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: List RMAN Plugin Session with Powershell

Post by oleg.feoktistov » 1 person likes this post

Hi Jochen,

Unfortunately, there isn't such cmdlet yet. But we have plans on adding it in one of the next product versions.
For now, you can use the workaround below to get plugin sessions:

Code: Select all

$job = Get-VBRPluginJob -Name 'RMAN'
$sessions = [Veeam.Backup.Core.CBackupSession]::GetAllSessionsByPolicyJob($Job.Id) 
Thanks,
Oleg
JMeixner
Veeam Legend
Posts: 6
Liked: 1 time
Joined: Apr 20, 2021 3:16 pm
Full Name: Jochen (Joe) Meixner
Contact:

Re: List RMAN Plugin Session with Powershell

Post by JMeixner »

Hello Oleg,
perfect, this was what I was looking for.
I was on the right track, but did not find the GetAllSessionsByPolicyJob...

Thank you,
Jochen
oleg.feoktistov
Veeam Software
Posts: 1912
Liked: 635 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: List RMAN Plugin Session with Powershell

Post by oleg.feoktistov »

I totally get you. A bunch of .NET methods are very subtle and quite challenging to interpret. Another reason to make a cmdlet :wink: Thanks!
Suryanarayanan
Influencer
Posts: 14
Liked: 3 times
Joined: Jul 09, 2021 12:42 pm
Full Name: Suryanarayanan
Location: Bangalore India
Contact:

Re: List RMAN Plugin Session with Powershell

Post by Suryanarayanan »

Code: Select all

$job1=Get-VBRPluginJob|where-object {$_.Type -eq "Backup" -and $_.PluginType -like "RMAN" -and $_.LastRun -ge (Get-Date).addhours(-24) }
foreach ($sessions in $job1) 
{
$jname1 = Get-VBRPluginJob -Name "$($sessions.Name)" 
$plugsess =[Veeam.Backup.Core.CBackupSession]::GetAllSessionsByPolicyJob($jname1.id) | where-object {$_.EndTime -ge (Get-Date).addhours(-24)}
foreach ($session in $plugsess) 
{
$session.gettasksessions()| Select-Object -Property Name,jobname,status,@{n='StartTime';e={$_.Progress.StartTimeLocal}}, @{n='EndTime';e={$_.Progress.StopTimeLocal}},@{n='TransferedSizeinMB';e={[math]::Round(($_.Progress.TransferedSize/1048576),2)}}

}
}
Post Reply

Who is online

Users browsing this forum: No registered users and 23 guests