Veeam Report Question

PowerShell script exchange

Veeam Report Question

Veeam Logoby micwv8 » Thu Nov 13, 2014 3:07 am

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: Thu Nov 13, 2014 2:51 am
Full Name: Michael Walkenhorst

Re: Veeam Report Question

Veeam Logoby micwv8 » Thu Nov 13, 2014 10:16 am

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

All working now.

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

Re: Veeam Report Question

Veeam Logoby v.Eremin » Thu Nov 13, 2014 12:47 pm

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.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Veeam Report Question

Veeam Logoby Backerupper » Wed Jan 07, 2015 12:57 pm 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!
Backerupper
Enthusiast
 
Posts: 42
Liked: 10 times
Joined: Fri Dec 28, 2012 2:32 pm

Re: Veeam Report Question

Veeam Logoby v.Eremin » Tue Jan 13, 2015 9:20 am

Thank you sharing the script with the community; highly appreciated. Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Veeam Report Question

Veeam Logoby Shaft » Tue Feb 03, 2015 1:45 pm

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
Shaft
Influencer
 
Posts: 10
Liked: never
Joined: Tue Nov 05, 2013 3:06 pm
Full Name: Vince Rucolas

Re: Veeam Report Question

Veeam Logoby v.Eremin » Tue Feb 03, 2015 2:07 pm

My script was about outputting objects IDs, not names. So, I'm not sure what names you're talking about. Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 4 guests