PowerShell script exchange
veremin
Product Manager
Posts: 18558
Liked: 1851 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: My Veeam Report v9.5.1

Post by veremin » 1 person likes this post

I think most of the required parts have been provided already, so, you just need to accommodate several examples to your needs. Re-reading the thread (especially, the posts by Oleg) and reviewing your own script line by line might be helpful in this case.

And if you feel stuck, do not hesitate to seek for assistance from professional services mentioned above.

Thanks!

Link State
Service Provider
Posts: 30
Liked: 5 times
Joined: Jan 06, 2014 9:58 am
Full Name: Link State
Contact:

[MERGED] My veeam Report V11 - Repository missing Info

Post by Link State »

HI guys,

I had modified that script for V10.
Now I have a problem with V11, the backup repository information is missing.
I read that the repo classes have been changed.
Could you please help me fix the report with the backup repository information?

thank you

Code: Select all

# Get Configuration Backup Info
$configBackup = Get-VBRConfigurationBackupJob
# Get VBR Server object
$vbrServerObj = Get-VBRLocalhost
# Get all Proxies
$proxyList = Get-VBRViProxy
# Get all Repositories
$repoList = Get-VBRBackupRepository
$repoListSo = Get-VBRBackupRepository -ScaleOut
# Get all Tape Servers
$tapesrvList = Get-VBRTapeServer
# Get Repository Info
$bodyRepo = $null
If ($showRepo) {
  If ($repoList -ne $null) {
    $arrRepo = $repoList | Get-VBRRepoInfo | Select @{Name="Repository Name"; Expression = {$_.Target}},
      @{Name="Type"; Expression = {$_.rType}}, @{Name="Max Tasks"; Expression = {$_.MaxTasks}},
      @{Name="Host"; Expression = {$_.RepoHost}}, @{Name="Path"; Expression = {$_.Storepath}},
      @{Name="Free (GB)"; Expression = {$_.StorageFree}}, @{Name="Total (GB)"; Expression = {$_.StorageTotal}},
      @{Name="Free (%)"; Expression = {$_.FreePercentage}},
      @{Name="Status"; Expression = {
        If ($_.FreePercentage -lt $repoCritical) {"Critical"}
        ElseIf ($_.StorageTotal -eq 0)  {"Warning"} 
        ElseIf ($_.FreePercentage -lt $repoWarn) {"Warning"}
        ElseIf ($_.FreePercentage -eq "Unknown") {"Unknown"}
        Else {"OK"}}
      }
    $bodyRepo = $arrRepo | Sort "Repository Name" | ConvertTo-HTML -Fragment       
    If ($arrRepo.status -match "Critical") {
      $repoHead = $subHead01err
    } ElseIf ($arrRepo.status -match "Warning|Unknown") {
      $repoHead = $subHead01war
    } ElseIf ($arrRepo.status -match "OK") {
      $repoHead = $subHead01suc
    } Else {
      $repoHead = $subHead01
    }    
    $bodyRepo = $repoHead + "Repository Details" + $subHead02 + $bodyRepo
  }
}

# Get Scale Out Repository Info
$bodySORepo = $null
If ($showRepo) {
  If ($repoListSo -ne $null) {
    $arrSORepo = $repoListSo | Get-VBRSORepoInfo | Select @{Name="Scale Out Repository Name"; Expression = {$_.SOTarget}},
      @{Name="Member Repository Name"; Expression = {$_.Target}}, @{Name="Type"; Expression = {$_.rType}},
      @{Name="Max Tasks"; Expression = {$_.MaxTasks}}, @{Name="Host"; Expression = {$_.RepoHost}},
      @{Name="Path"; Expression = {$_.Storepath}}, @{Name="Free (GB)"; Expression = {$_.StorageFree}},
      @{Name="Total (GB)"; Expression = {$_.StorageTotal}}, @{Name="Free (%)"; Expression = {$_.FreePercentage}},
      @{Name="Status"; Expression = {
        If ($_.FreePercentage -lt $repoCritical) {"Critical"}
        ElseIf ($_.StorageTotal -eq 0)  {"Warning"}
        ElseIf ($_.FreePercentage -lt $repoWarn) {"Warning"}
        ElseIf ($_.FreePercentage -eq "Unknown") {"Unknown"}
        Else {"OK"}}
      }
    $bodySORepo = $arrSORepo | Sort "Scale Out Repository Name", "Member Repository Name" | ConvertTo-HTML -Fragment
    If ($arrSORepo.status -match "Critical") {
      $sorepoHead = $subHead01err
    } ElseIf ($arrSORepo.status -match "Warning|Unknown") {
      $sorepoHead = $subHead01war
    } ElseIf ($arrSORepo.status -match "OK") {
      $sorepoHead = $subHead01suc
    } Else {
      $sorepoHead = $subHead01
    }
    $bodySORepo = $sorepoHead + "Scale Out Repository Details" + $subHead02 + $bodySORepo
  }
}
MCITP-MCP-MCSA-MCSE 2008 R2 -2012R2 - 2016: Core Infrastructure- MCSE: Cloud Platform and Infrastructure - CCNA - VMCE 2020 - Veeam Legends 2021

Egor Yakovlev
Veeam Software
Posts: 2118
Liked: 522 times
Joined: Jun 14, 2013 9:30 am
Full Name: Egor Yakovlev
Location: Prague, Czech Republic
Contact:

Re: My Veeam Report v9.5.1

Post by Egor Yakovlev »

Hi Link,

we have had an extensive discussion for the script upgrade to v11 above with examples of working parts on same matter.
Please check few pages up.

/Thanks!

morciodm
Novice
Posts: 7
Liked: 1 time
Joined: Sep 04, 2018 3:03 pm
Full Name: debra morcio
Contact:

[MERGED] myveeam report for v11

Post by morciodm »

Prior to the V11 upgrade the powershell script 'myveeam report' was functional.
As with the v10 upgrade i modified the version
$MVRversion = "11.0"

any suggestions?

Thank you in advance

Mildur
Veeam Legend
Posts: 982
Liked: 456 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian
Location: Switzerland
Contact:

[MERGED] Re: myveeam report for v11

Post by Mildur »

I don't know your report, but Veeam has changed the powershell feature for V11 from SnapIns to Powershell Modules.
It's possible, that it is not working because it uses old code in the beginning of the script which do not work in V11.

https://www.veeam.com/veeam_backup_11_0 ... new_wn.pdf
PowerShell
• PowerShell module — By popular demand, we switched from the PowerShell snap-in to the PowerShell
module, which can be used on any machine with the backup console installed. We also no longer require
PowerShell 2.0 installed on the backup server, which is something many customers had problems with
VMCE 9 | Veeam Legends 2021
Working with Veeam since 2017 for a VCSP in Switzerland
—————————————————————
VeeamOn 2021: https://www.veeam.com/veeamon

Natalia Lupacheva
Veeam Software
Posts: 732
Liked: 171 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 Debra,

moved your post to the existing thread to keep these discussions together.
Please take a look at this thread - it might give you a hint on your script.
Also, didn't actually get what exactly does not work in your script, maybe it would be a good idea to share some details.

Thanks!

chris.arceneaux
Veeam Software
Posts: 413
Liked: 221 times
Joined: Jun 24, 2019 1:39 pm
Full Name: Chris Arceneaux
Location: Kentucky, USA
Contact:

Re: My Veeam Report v9.5.1

Post by chris.arceneaux »

Hi Debra,

I received permission from the original author yesterday to update this script to work with the latest greatest v11 as he is no longer maintaining it. Once it's been created, I'll let you know where to get it here in this thread.

Until then, best to share more details about what's not working as well as check previous posts in this thread for guidance on updating the script to work with v11 as Natalia has recommended.

ober72
Veeam Legend
Posts: 672
Liked: 129 times
Joined: Jan 24, 2014 4:10 pm
Full Name: Geoff Burke
Contact:

Re: My Veeam Report v9.5.1

Post by ober72 »

Thanks Chris!!

This script is very useful.

cheers
Geoff Burke
Veeam Certified Architect
Certified Kubernetes Administrator (CKA)
Thinkon

spd2612
Lurker
Posts: 2
Liked: never
Joined: Jun 18, 2020 3:58 pm
Full Name: John T Martin
Contact:

Re: My Veeam Report v9.5.1

Post by spd2612 »

Chris
I also use this script and would like to get the updated version

josues
Lurker
Posts: 2
Liked: never
Joined: Jun 11, 2019 6:58 pm
Full Name: Josue Salomao Duarte da Silva
Contact:

Re: My Veeam Report v9.5.1

Post by josues »

Hi @chris.arceneaux

I also use this script and would like to get the updated version

Thanks!

chris.arceneaux
Veeam Software
Posts: 413
Liked: 221 times
Joined: Jun 24, 2019 1:39 pm
Full Name: Chris Arceneaux
Location: Kentucky, USA
Contact:

Re: My Veeam Report v9.5.1

Post by chris.arceneaux » 3 people like this post

Thanks for the support everyone! When it's ready, I'll post the link to the new location here. Stay tuned!

I expect this to be available within the next 2-3 weeks.

serkantek
Influencer
Posts: 10
Liked: never
Joined: Oct 08, 2017 11:23 pm
Full Name: Serkan Tek
Contact:

Re: My Veeam Report v9.5.1

Post by serkantek »

Release notes have the answer - VeeamPSSnapIn is ditched.
Working for me and I will use it until @chris.arceneaux posts a new version :D :D :D
Just need to comment the Load Veeam Snapin part like below:

Code: Select all

# Load Veeam Snapin
#If (!(Get-PSSnapin -Name VeeamPSSnapIn -ErrorAction SilentlyContinue)) {
#  If (!(Add-PSSnapin -PassThru VeeamPSSnapIn)) {
#    Write-Error "Unable to load Veeam snapin" -ForegroundColor Red
#    Exit
#  }
#}

Change the version on this too (your's might be v10 still)

If ($VeeamVersion -lt 11.0.0.836) {
  Write-Host "Script requires VBR v11 or greater" -ForegroundColor Red
  Write-Host "Version detected - $VeeamVersion" -ForegroundColor Red
  exit
}
Also if you have any other script you have created you just need to comment out VeeamPSSnapIn like below
#Add-PSSnapin -Name VeeamPSSnapIn

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests