PowerShell script exchange
Post Reply
l.vinokur
Enthusiast
Posts: 26
Liked: 10 times
Joined: Sep 25, 2017 6:37 am
Full Name: Leonid Vinokur
Contact:

List VMs in a backup session

Post by l.vinokur »

Hi,

I have isolated a given backup session in a variable. The job consists of several folders, so checking its "objects" is useless - they are folders.
I need to extract a list of VMs that were processed and their state - was the backup successful, etc.

Thanks!
wishr
Veteran
Posts: 3077
Liked: 455 times
Joined: Aug 07, 2018 3:11 pm
Full Name: Fedor Maslov
Contact:

Re: List VMs in a backup session

Post by wishr »

Hi Leonid,

If I got your question correctly (I hope so) then this EM functionality could help. Also, that thread sheds some light on other options.

Please let us know if you have any additional questions. Thanks.
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: List VMs in a backup session

Post by veremin » 1 person likes this post

Individual objects (VMs) should be present in task session which can be returned using the following approach:

Code: Select all

$Session.GetTaskSessions()
Thanks.
l.vinokur
Enthusiast
Posts: 26
Liked: 10 times
Joined: Sep 25, 2017 6:37 am
Full Name: Leonid Vinokur
Contact:

Re: List VMs in a backup session

Post by l.vinokur »

Vladimir, you rock :)
l.vinokur
Enthusiast
Posts: 26
Liked: 10 times
Joined: Sep 25, 2017 6:37 am
Full Name: Leonid Vinokur
Contact:

Re: List VMs in a backup session

Post by l.vinokur » 1 person likes this post

wishr wrote: Nov 28, 2018 11:22 am Hi Leonid,

If I got your question correctly (I hope so) then this EM functionality could help. Also, that thread sheds some light on other options.

Please let us know if you have any additional questions. Thanks.
Thanks Fedor, we don't have EM and the other post you've referenced actually revealed the same method that was demonstrated by Vladimir.

Best,
Leonid
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: List VMs in a backup session

Post by veremin »

The whole script might look like the following:

Code: Select all

asnp VeeamPSSnapin
$Job = Get-VBRJob -name "Name of your Job"
$Session = $Job.FindLastSession()
$Session | Get-VBRTaskSession  | select name, status
Should other help with scripting be needed, kindly, reach us.

Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests