PowerShell script exchange
Post Reply
LeoKurz
Veeam ProPartner
Posts: 27
Liked: 6 times
Joined: Mar 16, 2011 8:36 am
Full Name: Leonhard Kurz
Contact:

Find Sessions with specific transport mode

Post by LeoKurz »

Hi,

is there a way to find sessions with a specific transport mode (e.g. lan)? I have VEEAM One reporting some backups done by lan mode and I'd like to find out which vms/disks are backed up in this mode.

Thanx
__Leo

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

Re: Find Sessions with specific transport mode

Post by veremin »

Should it be only last sessions of given jobs or sessions from a specific time interval?

LeoKurz
Veeam ProPartner
Posts: 27
Liked: 6 times
Joined: Mar 16, 2011 8:36 am
Full Name: Leonhard Kurz
Contact:

Re: Find Sessions with specific transport mode

Post by LeoKurz »

First would be good, second perfect :-)

__Leo

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

Re: Find Sessions with specific transport mode

Post by veremin »

If you want to query only latest job sessions, you need to write something like this:

Code: Select all

Asnp VeeamPSSnapin
$NBDSessions = $Null
foreach ($Job in (Get-VBRJob | where {$_.JobType -eq "Backup"}))
{
$LastSession  = $Job.FindLastSession()
$NBDSessions = $NBDSessions + (Get-VBRTaskSession -Session $LastSession | where {$_.Logger.GetLog().updatedrecords.title -like "*nbd*"})
}
$NBDSessions | select @{N="Job Name";E={$_.JobName}}, @{N="VM Name";E={$_.Name}}, @{N="NBD diks";E={($_.Logger.GetLog().updatedrecords.title | where {$_ -like "*nbd*"})}} | ft -AutoSize
Thanks.

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests