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

Re: My Veeam Report v9.5.1

Post by oleg.feoktistov »

Hi John,

For some reason I cannot open Shawn's blog. Seems like his tenant is no longer available.
So, I cannot see what is needed to be changed there precisely to help you.
However, here is the option you can try:

Code: Select all

Get-VBRComputerBackupJobSession | select Id, JobId, Status, Result
As far as I see, for VBRComputerBackupJob type parsed with Get-VBRComputerBackupJob NextRun property is not implemented.
For CBackupJob type retrievable with Get-VBRJob NextRun renders empty as agent jobs are no longer supported by this cmdlet.

Thanks,
Oleg
chris.arceneaux
VeeaMVP
Posts: 667
Liked: 358 times
Joined: Jun 24, 2019 1:39 pm
Full Name: Chris Arceneaux
Location: Georgia, USA
Contact:

Re: My Veeam Report v9.5.1

Post by chris.arceneaux » 2 people like this post

For future readers of this thread, here's the direct link to Shawn's script on GitHub:

https://gist.github.com/smasterson/9136468
MiMaMo
Novice
Posts: 7
Liked: 4 times
Joined: Feb 27, 2020 3:04 pm
Full Name: Michael
Contact:

Re: My Veeam Report v9.5.1

Post by MiMaMo »

Hi!

For the current version 10a the script must be changed as follows:

Code: Select all

If ($VeeamVersion -lt 10.0.1.4854) {
  Write-Host "Script requires VBR v10.0.1.4854" -ForegroundColor Red
  Write-Host "Version detected - $VeeamVersion" -ForegroundColor Red
  exit
}
If executed I got an error in line 998 but I can't see an error in the output. So for me the script is working well enough. :D

Code: Select all

PS E:\> .\VeeamReport.ps1
Attempted to divide by zero.
At E:\VeeamReport.ps1:998 char:7
+       $repoObj = New-Object -TypeName PSObject -Property @{
+       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], RuntimeException
    + FullyQualifiedErrorId : RuntimeException
Maybe someone else please can have a look into the "divide by zero" error? Thanks in advance! :-)
oleg.feoktistov
Veeam Software
Posts: 1912
Liked: 635 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: My Veeam Report v9.5.1

Post by oleg.feoktistov » 1 person likes this post

Hi Michael,

Cannot test my theory any time soon, but I'd look towards contents of $total variable:

Code: Select all

 $repoObj = New-Object -TypeName PSObject -Property @{
        Target = $name
        RepoHost = $repohost
        Storepath = $path
        StorageFree = [Math]::Round([Decimal]$free/1GB,2)
        StorageTotal = [Math]::Round([Decimal]$total/1GB,2)
        FreePercentage = [Math]::Round(($free/$total)*100) # Divides by zero here.
        MaxTasks = $maxtasks
        rType = $rtype
      }
On line 1019 it is passed as an argument to Build-Object function from CBackupRepository.InfoCachedTotalSpace property:

Code: Select all

$outputObj = Build-Object $r.Name $($r.GetHost()).Name.ToLower() $r.Path $r.info.CachedFreeSpace $r.Info.CachedTotalSpace $r.Options.MaxTaskCount $rType
Try checking which repository might be rendering 0 total space.

Thanks,
Oleg
GianlucaCroci
Expert
Posts: 214
Liked: 20 times
Joined: Feb 26, 2019 12:08 pm
Full Name: Gianluca Croci
Contact:

MyVeeamReport.ps1 and Veeam v10

Post by GianlucaCroci »

Hello,
I've a question about the "MyVeeamReport.ps1" report. After the Veeam upgrade to V10, this report doesn't work.
I guess in the new version there will be some commands that have changed but despite having found and changed the below, it still doesn't work.


1)
replace Get-VBRJob with Get-VBRComputerbackupJob

and

2)
#region Report
# Get Veeam Version
$VeeamVersion = Get-VeeamVersion

#If ($VeeamVersion -lt 9.5) {
# Write-Host "Script requires VBR v9.5" -ForegroundColor Red
# Write-Host "Version detected - $VeeamVersion" -ForegroundColor Red
# exit
If ($VeeamVersion -lt *10.0.0.4461*) {
Write-Host "Script requires VBR v10" -ForegroundColor Red
Write-Host "Version detected - $VeeamVersion" -ForegroundColor Red
exit
}



Did anyone find any further changes to make to the report?

Thanks in advance.
Kind regards
GianlucaCroci
oleg.feoktistov
Veeam Software
Posts: 1912
Liked: 635 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: My Veeam Report v9.5.1

Post by oleg.feoktistov »

Ciao Gianluca,

Merged your post with the existing thread. Any particular error shown/data not being parsed in the report generated?

Thanks,
Oleg
MiMaMo
Novice
Posts: 7
Liked: 4 times
Joined: Feb 27, 2020 3:04 pm
Full Name: Michael
Contact:

Re: My Veeam Report v9.5.1

Post by MiMaMo »

In my newest reports where I changed the licensing from "Sockets" to "Instances" I got an error in the report about the License status:

Code: Select all

License/Support Renewal Date
Expiry Date		Days Remaining		Status
WMI Connection Failed	WMI Connection Failed	OK
But as the message is "green" it do not disturb the report status itself.
GianlucaCroci
Expert
Posts: 214
Liked: 20 times
Joined: Feb 26, 2019 12:08 pm
Full Name: Gianluca Croci
Contact:

Re: My Veeam Report v9.5.1

Post by GianlucaCroci »

Hi Oleg,
thanks a lot.

At the moment I've this error "Unable to connect to VBR server".

I've tryed the connection with the FQDN of the server, and with "127.0.0.1" too (the script is executed on the server Veeam), and added the port "9392" for the connection, but nothing change.

Any idea?

Thanks
Kind regards
Gianluca
Natalia Lupacheva
Veteran
Posts: 1143
Liked: 302 times
Joined: Apr 27, 2020 12:46 pm
Full Name: Natalia Lupacheva
Contact:

Re: My Veeam Report v9.5.1

Post by Natalia Lupacheva »

Hi Gianluca,

May I ask for some clarification here?
When exactly do you get this error message, on the report execution or when you just try to run any script?

Thanks!
GianlucaCroci
Expert
Posts: 214
Liked: 20 times
Joined: Feb 26, 2019 12:08 pm
Full Name: Gianluca Croci
Contact:

Re: My Veeam Report v9.5.1

Post by GianlucaCroci »

Hi Natalia,
I've few reports. The base is "MyVeeamReport.ps1", but I've divided by type, so I don't have a too long report.
At the moment I've modified only one. When it'll work, I'll the same modifs on the others.
So I run this report and after 10-15 seconds I receive this error. I think as first try the connection with Veeam Server but go in timeout...

Thanks.
Kind regards
Gianluca
Natalia Lupacheva
Veteran
Posts: 1143
Liked: 302 times
Joined: Apr 27, 2020 12:46 pm
Full Name: Natalia Lupacheva
Contact:

Re: My Veeam Report v9.5.1

Post by Natalia Lupacheva » 1 person likes this post

Gianluca,

ok, seems I managed to reproduce the issue.
Did you try with

Code: Select all

$vbrServer = "localhost"
configuration?

Thanks!
GianlucaCroci
Expert
Posts: 214
Liked: 20 times
Joined: Feb 26, 2019 12:08 pm
Full Name: Gianluca Croci
Contact:

Re: My Veeam Report v9.5.1

Post by GianlucaCroci »

Thanks a lot. Worked.

Now I make the changes also on the others and then I perform a round of execution of all :-)

Kind regards
Gianluca
GianlucaCroci
Expert
Posts: 214
Liked: 20 times
Joined: Feb 26, 2019 12:08 pm
Full Name: Gianluca Croci
Contact:

Re: My Veeam Report v9.5.1

Post by GianlucaCroci »

all modified and all tested. Work well...

Thanks Natalia.

Kind regards
Gianluca
JudgeWolf
Lurker
Posts: 1
Liked: never
Joined: Oct 07, 2020 1:26 pm
Full Name: Philip
Contact:

Re: My Veeam Report v9.5.1

Post by JudgeWolf »

Hello,

I have a question has anyone in this forum tried or managed to implement File Copy into the report? In my case the "Next Run" and the "Traget" are not shown.

Image
GianlucaCroci
Expert
Posts: 214
Liked: 20 times
Joined: Feb 26, 2019 12:08 pm
Full Name: Gianluca Croci
Contact:

Re: My Veeam Report v9.5.1

Post by GianlucaCroci »

Hello Philip,
I have a FileCopy job and I hadn't thought of implementing it in the Report (congratulations).
At the moment I only use the Report that Veeam generates after execution.
How did you go about implementing it in the Report?
tsmagnum
Novice
Posts: 6
Liked: 5 times
Joined: Feb 26, 2021 7:34 am
Full Name: T.S. Magnum
Contact:

Re: My Veeam Report v9.5.1

Post by tsmagnum » 2 people like this post

MiMaMo wrote: Sep 29, 2020 8:08 am In my newest reports where I changed the licensing from "Sockets" to "Instances" I got an error in the report about the License status:

Code: Select all

License/Support Renewal Date
Expiry Date		Days Remaining		Status
WMI Connection Failed	WMI Connection Failed	OK
But as the message is "green" it do not disturb the report status itself.
Hi everyone, I managed to fix this error in the report.
In the original version of the script, line 1162 was:

Code: Select all

$pattern = "expiration date\=\d{1,2}\/\d{1,2}\/\d{1,4}"
In VBR 10 this is not working anymore, because the text pattern is different and PowerShell throws a null value error. You have to change this line to:

Code: Select all

$pattern = "License expires\=\d{1,2}\/\d{1,2}\/\d{1,4}"
After this small modification, the license section will work again as expected, I tested it in VBR 10.

Hope this helps!
matteu
Veeam Legend
Posts: 703
Liked: 114 times
Joined: May 11, 2018 8:42 am
Contact:

Re: My Veeam Report v9.5.1

Post by matteu »

Hello,

Is it possible to upload version compatible for v11 ?
Is there any existing script to know what VM are in vcenter and are not in VBR backup job ?

Thanks :)
jhoughes
Veeam Vanguard
Posts: 279
Liked: 112 times
Joined: Apr 20, 2017 4:19 pm
Full Name: Joe Houghes
Location: Castle Rock, CO
Contact:

Re: My Veeam Report v9.5.1

Post by jhoughes » 1 person likes this post

You should be able to see how to change the version through earlier posts in this thread, and you can also just comment out the line for the PSSnapin to eliminate any errors.

As for VMs not in a backup job, the best route would be the "Protected VMs" report in VeeamOne.

To report on this in PowerShell, the code required for this would be different if you are using only VMs as job objects, versus any VM container objects (cluster/datastore/resource pool/tag) to be able to validate each and determine which VMs are missing.
Husband, Father, Solutions Architect, Geek Extraordinaire | @DenverVMUG, @AustinVMUG & @ATXPowerShell leader | VMware vExpert | Cisco Champion
matteu
Veeam Legend
Posts: 703
Liked: 114 times
Joined: May 11, 2018 8:42 am
Contact:

Re: My Veeam Report v9.5.1

Post by matteu »

Thank your for your answer.
kalaimani53
Enthusiast
Posts: 25
Liked: 1 time
Joined: Jul 14, 2020 1:43 pm
Full Name: Kalaimani
Contact:

[MERGED] Not working Get Repository Info in powershell after upgrade 11

Post by kalaimani53 »

Dear Team,

I Not able to create a new post in your Forum

I'm looking for support regards to get the Get Repository Info using
Powershell. the below script was working before the upgrade to 11. after
the upgrade it's stopped working

Code: Select all

Get-VBRRepoInfo : The term 'Get-VBRRepoInfo' is not recognized as the name
of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was
included, verify that the path is correct and try
again.
At E:\Arts\AuditandDailyHealthCheckReport\Report\GHCSVeeamReport.ps1:3874
char:28
+     $arrRepo = $repoList | Get-VBRRepoInfo | Select @{Name="Repositor ...
+                            ~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-VBRRepoInfo:String) [],
CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Get-VBRSORepoInfo : The term 'Get-VBRSORepoInfo' is not recognized as the
name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was
included, verify that the path is correct and try
again.
At E:\Arts\AuditandDailyHealthCheckReport\Report\GHCSVeeamReport.ps1:3904
char:32
+     $arrSORepo = $repoListSo | Get-VBRSORepoInfo | Select @{Name="Sca ...
+                                ~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-VBRSORepoInfo:String)
[], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
Need your support to fix the issue
Egor Yakovlev
Veeam Software
Posts: 2536
Liked: 680 times
Joined: Jun 14, 2013 9:30 am
Full Name: Egor Yakovlev
Location: Prague, Czech Republic
Contact:

[MERGED] Re: Not working Get Repository Info in powershell after upgrade 11

Post by Egor Yakovlev »

Those cmdlet names do not seem to be provided by native Veeam PowerShell module.
Maybe you are using some custom functions like ones from Github?
In this case, re-import them to work - your system clearly lost it. Also Github thread has corrected v11 code in the comments.
/Cheers!
Voltron
Influencer
Posts: 10
Liked: never
Joined: Apr 05, 2019 2:41 pm
Full Name: Paul Leclair
Contact:

Re: My Veeam Report v9.5.1

Post by Voltron »

Has anyone been able to get this script working properly with v11? it appears that the script won't run because it can't add the veeam powershell modules properly. That is as far as I got with it.

Thanks!
jhoughes
Veeam Vanguard
Posts: 279
Liked: 112 times
Joined: Apr 20, 2017 4:19 pm
Full Name: Joe Houghes
Location: Castle Rock, CO
Contact:

Re: My Veeam Report v9.5.1

Post by jhoughes » 1 person likes this post

Comment out the line for the PSSnapin. You can change it to import the module, or let PowerShell auto-loading handle it for you.

You'll also need to change the version number, which you can find higher up on this page.
Husband, Father, Solutions Architect, Geek Extraordinaire | @DenverVMUG, @AustinVMUG & @ATXPowerShell leader | VMware vExpert | Cisco Champion
kalaimani53
Enthusiast
Posts: 25
Liked: 1 time
Joined: Jul 14, 2020 1:43 pm
Full Name: Kalaimani
Contact:

[MERGED] Re: Not working Get Repository Info in powershell after upgrade 11

Post by kalaimani53 »

yes, I'm using some custom functions from Github. if possible someone helps me to get the Get Repository Info in PowerShell
Voltron
Influencer
Posts: 10
Liked: never
Joined: Apr 05, 2019 2:41 pm
Full Name: Paul Leclair
Contact:

Re: My Veeam Report v9.5.1

Post by Voltron »

Thanks jhoughes. That did the trick for me along with updating the version string.
jhoughes
Veeam Vanguard
Posts: 279
Liked: 112 times
Joined: Apr 20, 2017 4:19 pm
Full Name: Joe Houghes
Location: Castle Rock, CO
Contact:

[MERGED] Re: Not working Get Repository Info in powershell after upgrade 11

Post by jhoughes »

We would need to see the actual script you are running. All we can tell from your error is that you are running a script that contains 2 named functions of 'Get-VBRRepoInfo' and 'Get-VBRSORepoInfo'.

Since these aren't cmdlets built into Veeam PowerShell, this means there is a problem with your script, whether it contains the functions directly or loads them from another script.

We cannot diagnose anything around that based on only the error message you posted.
Husband, Father, Solutions Architect, Geek Extraordinaire | @DenverVMUG, @AustinVMUG & @ATXPowerShell leader | VMware vExpert | Cisco Champion
jhoughes
Veeam Vanguard
Posts: 279
Liked: 112 times
Joined: Apr 20, 2017 4:19 pm
Full Name: Joe Houghes
Location: Castle Rock, CO
Contact:

Re: My Veeam Report v9.5.1

Post by jhoughes »

@kalaimani53, this is what you are looking for to resolve your issues.
Husband, Father, Solutions Architect, Geek Extraordinaire | @DenverVMUG, @AustinVMUG & @ATXPowerShell leader | VMware vExpert | Cisco Champion
kalaimani53
Enthusiast
Posts: 25
Liked: 1 time
Joined: Jul 14, 2020 1:43 pm
Full Name: Kalaimani
Contact:

Re: My Veeam Report v9.5.1

Post by kalaimani53 »

Sorry, that is not my issue, I'm trying to get the repository information like repository name, total space and free space
jhoughes
Veeam Vanguard
Posts: 279
Liked: 112 times
Joined: Apr 20, 2017 4:19 pm
Full Name: Joe Houghes
Location: Castle Rock, CO
Contact:

Re: My Veeam Report v9.5.1

Post by jhoughes » 1 person likes this post

Ok, in a DM you sent me only a link to the gist for the exact script that this entire thread is focused on, while asking to "help me to fix the issue".

If the other fixes listed here do not resolve anything, then please explain your exact issue. Without information, we cannot assist to diagnose either the problem, nor the resolution.

Your originak post has error messages due to the functions not being found in memory in PowerShell, after your upgrade to v11. This would most likely be the module not being imported, if you didn't modify the script to update from adding the snap-in to importing the module.

If the script is not run from the Veeam server itself, can you confirm that the machine running the script has had the console updated, rather than just the Veeam server?

If you only need to be able to pull repository space information by itself, please check this thread:
powershell-f26/v11-get-vbrbackupreposit ... 72415.html
Husband, Father, Solutions Architect, Geek Extraordinaire | @DenverVMUG, @AustinVMUG & @ATXPowerShell leader | VMware vExpert | Cisco Champion
kalaimani53
Enthusiast
Posts: 25
Liked: 1 time
Joined: Jul 14, 2020 1:43 pm
Full Name: Kalaimani
Contact:

Re: My Veeam Report v9.5.1

Post by kalaimani53 » 1 person likes this post

1st errors is not able to add the Add-PSSnapin veeampssnapin

when trying to add getting the below error message

Code: Select all

PS C:\ Add-PSSnapin veeampssnapin
Add-PSSnapin : The Windows PowerShell snap-in 'veeampssnapin' is not installed on this computer.
At line:1 char:1
+ Add-PSSnapin veeampssnapin
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (veeampssnapin:String) [Add-PSSnapin], PSArgumentException
    + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand
Post Reply

Who is online

Users browsing this forum: No registered users and 21 guests