PowerShell script exchange
Post Reply
micwv8
Novice
Posts: 9
Liked: never
Joined: Nov 13, 2014 2:51 am
Full Name: Michael Walkenhorst
Contact:

Veeam Report Question

Post by micwv8 »

Hi,

We made the move to Veeam 8 earlier this week. It is working well.

I know Veeam Support does not cover PowerShell, so I thought I would post this question here.

One of 'my' scripts (it's actually a script I found – "My Veeam Report" from Shawn Masterson's Blog) is now broken. It is only one line that is broken though (I think).

That one broken line is:
$jobobjids = [Veeam.Backup.Core.CHierarchyObj]::GetObjectsOnHost($vcenterobj.id) | Where-Object {$_.GetItem().Type -eq "Vm"}

The error message is:
Method invocation failed because [Veeam.Backup.Core.CHierarchyObj] doesn't contain a method named 'GetItem'.
At line:1 char:98
+ ... Where-Object {$_.GetItem().Type -eq "Vm"}
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : MethodNotFound


Would anyone know how I can now obtain Veeam job ids using PowerShell in Veeam 8?

Thanks.

Michael
micwv8
Novice
Posts: 9
Liked: never
Joined: Nov 13, 2014 2:51 am
Full Name: Michael Walkenhorst
Contact:

Re: Veeam Report Question

Post by micwv8 »

I realized the code worked if I simply removed the GetItem()

All working now.

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

Re: Veeam Report Question

Post by veremin »

Even though I have no clues on what source code looks like, I still believe that Job Objects ID can be found in easier way:

Code: Select all

$jobobjids  = (Get-VBRJob -name "Name of your backup").GetObjectsInJob().id
Thanks.
Backerupper
Enthusiast
Posts: 47
Liked: 24 times
Joined: Dec 28, 2012 2:32 pm
Contact:

Re: Veeam Report Question

Post by Backerupper » 1 person likes this post

fyi - the script report has been updated with a few minor tweaks for VBR v8

http://blog.smasterson.com/2014/12/18/m ... 8-support/

Hope you find it useful!
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Veeam Report Question

Post by veremin »

Thank you sharing the script with the community; highly appreciated. Thanks.
Shaft
Influencer
Posts: 17
Liked: never
Joined: Nov 05, 2013 3:06 pm
Full Name: Vince Rucolas
Contact:

Re: Veeam Report Question

Post by Shaft »

micwv8 Thanks for posting this I use this script often and when I found it did not work when I upgraded I not happy.

A note to v.Eremin, your suggestion did not work for me because my jobs are setup via folders and this only gives the folder names not the VMs.

Thanks again to all :mrgreen: :lol: :D
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Veeam Report Question

Post by veremin »

My script was about outputting objects IDs, not names. So, I'm not sure what names you're talking about. Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests