Veeam v9 – My Veeam Report 9.5.3

My Veeam Report has been updated for the release of VBR 9.5 Update 3. If you’re ready to install Update 3, you’ll want to update My Veeam Report as well.

What’s New

This minor update fixes a couple of property changes introduced with VBR 9.5 Update 3. The good news is that you can copy and paste your entire User-Variables region from your 9.5.1 report making the transition fairly simple.

Sample Report
A sample report can be found here.

Setup

Download

Download the zip or copy and paste into a .ps1 file from here.

Configure

The next step is to configure the (many!) script options which is done in the User-Variables region. There are three variables that must be configured before running.

1) Add your VBR server name

# VBR Server (Server Name, FQDN or IP)
$vbrServer = "yourVBRserver"

2) Ensure the path to the Veeam executable is correct

# Location of Veeam executable (Veeam.Backup.Shell.exe)
$veeamExePath = "C:\Program Files\Veeam\Backup and Replication\Backup\Veeam.Backup.Shell.exe"

3) Configure Email Settings (or optionally the ‘Save HTML output to file’ section)

# Email configuration
$sendEmail = $true
$emailHost = "smtp.yourserver.com"
$emailPort = 25
$emailEnableSSL = $false
$emailUser = ""
$emailPass = ""
$emailFrom = "MyVeeamReport@yourdomain.com"
$emailTo = "you@youremail.com"

From here I would familiarize yourself with all the different options the report has to offer. Everyone likes to see something different and the report can be customized to show only the data that is important to you.

I’ll note again that as there are so many items possibly returned from the script I foresee some folks setting up multiple scripts for best results. For example, one script to run a daily report on backups, another weekly report for Tape Backup Jobs and possibly another that just lists expired tapes on Fridays – it’s completely up to you, your processes and the size of your environment.

Validate Everything!

Though I have tried my best to test every possible outcome of the report, I will not be astonished if I have overlooked or fat-fingered something along the way. Please do us all a favor and validate the output against your console to ensure the data returned is correct. If you find something off, please let me know so everyone can benefit from the fix.

Thank You

Lastly, I would once again like to thank all the past and present contributors to this project. I’m not sure I would have had the motivation to start and continue this project entirely on my own and am grateful for all whom have given advice, insight, tested and/or contributed.

Advertisements

53 thoughts on “Veeam v9 – My Veeam Report 9.5.3

  1. Anthony Cogswell

    As always thanks for the update. Any plans on gathering information on Protection Groups and The backup Jobs using those protection groups? Not seeing my new backups jobs based on the groups in the report.

    Reply
      1. Wouter

        You can get a trail license from Veeam if you register.
        I have been using your scripts for some time now and it is the best out there!
        Unfortunately all of our agents are now part of protection groups which are not showing in the reports.

      2. wouterlenaerts

        You can get a license key from Veeam. I have been using your script for some time now and it is the best out there! Unfortunately all our agents are now part of the protection group so I am now stuck to console monitoring. 😦

  2. Vaibhav Shah

    I am trying to user Veeam report 9.5.3. I am getting failed error for VM backup Protection Summary and VMs with No successful backups within RPO. I am not backing up all the VMs in vcenter. How can I run report only on the machine i am backing up to avoid this failed error?

    Reply
    1. smasterson Post author

      You can exclude systems by datacenter, folder or name (including wildcards)

      # Exclude VMs from Missing and Successful Backups sections
      # $excludevms = @(“vm1″,”vm2″,”*_replica”)
      $excludeVMs = @(“”)
      # Exclude VMs from Missing and Successful Backups sections in the following (vCenter) folder(s)
      # $excludeFolder = @(“folder1″,”folder2″,”*_testonly”)
      $excludeFolder = @(“”)
      # Exclude VMs from Missing and Successful Backups sections in the following (vCenter) datacenter(s)
      # $excludeDC = @(“dc1″,”dc2″,”dc*”)
      $excludeDC = @(“”)

      Reply
      1. Vaibhav Shah

        thanks for the prompt reply. I am backing 40 machines out of 250 vm. Also they are from different folder and single data-center. Is there better way to cover that?

      2. Vaibhav Shah

        Thanks Jonathan, I tried turn off those part by writing false but it didn’t work. Those part just not showing on the report but still the report shows as failed.

      3. smasterson Post author

        There must/should be something in the report that is coming up as failed. Could be license check, repository status, etc.
        Feel free to forward me a copy of the report and I can take a look for you – smasterson @ gmail

      4. Vaibhav Shah

        That is what i was thinking and i just ran the raw report without any modification and it came failed with only two filed 1
        1)VM backup Protection Summary
        2)VMs with No successful backups within RPO.

        Rest of the fields are green. I will fw you the report.

  3. Jonathan

    What a great project you have here. I’ve started using it about a month ago and it makes things much easier to manage and helped me find a few deficiencies.

    I just updated my script to this most recent one 9.5.3 but have not yet updated VBR to 9.5.3 and am getting this error:

    Get-Date : Cannot bind parameter ‘Date’ to the target. Exception setting “Date”: “Object reference not set to an instance of an object.”
    At D:\Reporting\Scripts\get-veeamreport-953.ps1:1267 char:23
    + If ((Get-Date $vmtask.Progress.StartTimeLocal) -ge (Get-Date $vms[$vmtas …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : WriteError: (:) [Get-Date], ParameterBindingException
    + FullyQualifiedErrorId : ParameterBindingFailed,Microsoft.PowerShell.Commands.GetDateCommand

    I’d also like to recommend the option of including a list of Excluded hostnames

    Reply
    1. smasterson Post author

      For VBR 9.5 Update 1 & 2 you should be using MVR 9.5.1 found in the previous post (wouldn’t let me link in comments..)
      9.5.3 has no major changes other than fixing changes introduced with Update 3.

      Unfortunately excluding via hostname doesn’t look possible as the hostname is not returned when a vCenter is used (only the Cluster).

      Reply
      1. Jonathan

        To be more clear, an option to include in the report the hostnames that have been added to an exclusion list. This would come from the variables in the script, not vcenter.

  4. Mikkel Andreasen

    Hi,
    First time user, and very impressed. Nice work!
    I had a single issue running the script, line 1267 kept generating errors
    Get-Date $vmtask.Progress.StartTimeLocal and Get-Date $vmtask.Progress.StopTimeLocal had to be replaced with
    Get-Date $vmtask.Progress.StartTime Get-Date $vmtask.Progress.StopTime
    Now it just works 🙂

    I did make a second change to make it a bit more dynamic during my testing, by including this input parameters I could change reportmode and basic e-mail from the command line.

    Param (
    [string]$vbrServer = “localhost”,
    [string]$reportMode = 24,
    [string]$emailTo = “man@mycompany.gl”,
    [boolean]$sendEmail = $true,
    [boolean]$Debug = $false
    )

    Reply
    1. smasterson Post author

      It looks as though you are running MVR 9.5.3 without yet installing VBR 9.5 Update 3.
      You could either a) install Update 3 or b) revert to MVR 9.5.1 to alleviate the errors you are seeing.

      Reply
  5. Tom stevens

    Any Idea how to Show only Replication Tasks and status in the Report? Running the script and not showing Replication Tasks/Status only Replica Target Details for 1 Host

    Reply
  6. Dale

    Love this Script. I’ve been using it for quite some time now. I really love the html formatting in a previous version where the status was highlighted in a block instead of the text. Is there are convenient way to modify this?

    I want this: https://www.dropbox.com/s/nirib1ztcbw291n/Screen%20Shot%202018-01-14%20at%2010.52.09%20AM.png?dl=0

    vs this (current version): https://www.dropbox.com/s/jkktgqk821vre83/Screen%20Shot%202018-01-14%20at%2010.52.47%20AM.png?dl=0

    Reply
  7. fishy

    Dear smasterson!
    great script and thanks for sharing it with us!

    I’ve a question about the Backup Job Size,
    This is the backup size of the vm backups of each job, for example SQL Logfiles (.vlb) are not included at this size.
    Is it possible to report the vlb sizes of each job too?

    br
    fishy

    Reply
    1. smasterson Post author

      You are correct that SQL logfiles are not included in the function used (Get-VBRBackup). I don’t believe there is an easy way to do this without parsing the log file for each VM.

      Reply
  8. Massou JM

    thank you very much :! What a piece of art ! your script is great to learn Powershell too and so useful, Impressive :!

    This is my two cents because i was using your last script for my own need :
    What about an ESX based exclusion rules like that ?

    # (line 90 ~=) define Esx to exclude
    $excludeESX = @(“esa00099.idontwantyou.com”,”esa00098.idontwantyou.com”)

    # (line 1250 ~=) use your smart “join regex array …. :!”
    $excludeESX_regex = (‘(?i)^(‘ + (($script:excludeESX | ForEach {[regex]::escape($_)}) -join “|”) + ‘)$’) -replace “\\\*”, “.*”

    # (line 1254 ~=) Add a new Exclusion condition to Find-VBRViEntity

    Find-VBRViEntity |
    Where-Object {$_.Type -eq “Vm” -and $_.VmFolderName -notmatch $excludefolder_regex} |
    Where-Object {$_.Name -notmatch $excludevms_regex} |
    Where-Object {$_.Path.Split(“\”)[1] -notmatch $excludedc_regex} |
    Where-Object {$_.VmHostName -notmatch $excludeESX_regex} |

    Reply
    1. smasterson Post author

      At first glance it appears as though this would certainly work.
      The only add I would have is to be sure to add the additional Where-Object to both Find-VBRViEntity calls (lines 1247/1253) to ensure you are excluding both VMs and Templates (depending on configuration).

      Reply
  9. BackupDude

    I’ve been stuck with a problem to include in the report usage from the License section of: nr of VMs, Number of used agents (server vs workstation). Is there a way that You could include that?

    Reply
  10. Tm

    Hi Shawn,

    Many thanks for the script, works a treat and have been using it with customizations for a while now.

    One thing that isn’t working for us since Veeam 9.5.3 is that the Agent for Windows 2.1 jobs are now longer picked up/reported at all, these have been added to regular backup jobs as opposed to the older Agent jobs that populated back into B&R when a job was run.

    When running Get-VBRJob – the new jobs containing/managing the 2.1 Agent for Windows don’t even show up. Same again if running Get-VBREPJob – Possibly a Veeam thing or perhaps I’m missing the corect command?

    Cheers

    Reply
    1. smasterson Post author

      Unfortunately I don’t have licenses for the new agents so it is hard for me to look into it. I also am unable to find cmdlets for the new protection groups.

      Reply
  11. John Quinn

    Thanks for the updated script. In your comments you mentioned;
    #region VersionInfo
    $MVRversion = “9.5.3”
    # Version 9.5.3 – SM
    # Updated property changes introduced in VBR 9.5 Update 3

    Can you explain more about the changes. We have this script running a new locations and its working great for non- update 3 locations. But if we run it manually we get no errors, but it doesn’t pull the VM/task status on update 3 systems; however, Session Info is pulled correctly and repository info are pulled correctly on the update 3 systems. Did veeam change their API in update 3.

    Did syntax or cmdlets change in this script from the previous version?

    Reply
    1. smasterson Post author

      The biggest change was in many of the Progress properties.

      Prior to VBR Update 3 they looked similar to:
      $vmtask.Progress.StartTime
      $vmtask.Progress.StopTime

      After Update 3 they now look similar to:
      $vmtask.Progress.StartTimeLocal
      $vmtask.Progress.StopTimeLocal

      Reply
  12. Erik Therkildson

    The report is great, I am just trying to sort an error that I am getting and wanted to see if you could provide some insight.

    Get-Date : Cannot bind parameter ‘Date’ to the target. Exception setting “Date”: “Object reference not set to an instance of an object.”
    At C:\scripts\report1.ps1:1267 char:23
    + If ((Get-Date $vmtask.Progress.StartTimeLocal) -ge (Get-Date $vms[$vmtas

    Reply
    1. smasterson Post author

      It looks as though you are running the latest version of the report (9.5.3) against a VBR 9.5 server that does not have Update 3 installed.
      Options include installing VBR 9.5 Update 3 or using an older version of the report (9.5.1).

      Reply
  13. Daniel

    Hi Shawn
    It is really a great Report and very Handy – great work!

    I use Veeam 9.5 Update 3 and your report 9.5.3 and use it in a Hyper-V Environment.

    I have one problem:
    My Report does not show up anything in the “VM Backup Protection Summary” and I also do not get the protected/unprotected VMs listed, all values are empty and categories are missing. Parameters in the config section are set to “true”
    I have tested with Hyper-V 2012 R2 and Hyper-V 2016. The same script in a vSphere environment shows up those sections/systems.

    With Report Version 9.0.1 this was working fine

    Any ideas?

    Reply
    1. smasterson Post author

      Agreed, they haven’t implemented any powershell support for the protection groups for the new (paid) agents.
      Old (free) agents are still supported.
      I’d dare to guess that they will create new cmdlets for the new protection groups/agents.

      Reply
  14. Erik Therkildson

    I was looking for a way to add totals to the Get Backup Job Size. I came up with the following code that adds totals in, but it is not the cleanest method. Thought maybe you have a better way to do this.

    # Get Backup Job Size
    $bodyJobSizeBk = $null
    $bodyJobSizeBkt = $null
    $vmcount = $null
    $vmdatasize = $null
    $vmbackupsize = $null
    If ($showBackupSizeBk) {
    If ($backupsBk.count -gt 0) {
    $bodyJobSizeBk = Get-BackupSize -backups $backupsBk | Sort JobName | Select @{Name=”Job Name”; Expression = {$_.JobName}},
    @{Name=”VM Count”; Expression = {$_.VMCount}},
    @{Name=”Repository”; Expression = {$_.Repo}},
    @{Name=”Data Size (GB)”; Expression = {$_.DataSize}},
    @{Name=”Backup Size (GB)”; Expression = {$_.BackupSize}} #| ConvertTo-HTML -Fragment

    Get-BackupSize -backups $backupsBk | Sort JobName | ForEach {
    $vmcount += $_.VMCount
    $vmdatasize += $_.DataSize
    $vmbackupsize += $_.BackupSize
    }
    $bodyJobSizeBkt = Get-BackupSize -backups $backupsBk | Select @{Name=”Job Name”; Expression = {“Total”}},
    @{Name=”VM Count”; Expression = {$vmcount}},
    @{Name=”Repository”; Expression = {$null}},
    @{Name=”Data Size (GB)”; Expression = {$vmdatasize}},
    @{Name=”Backup Size (GB)”; Expression = {$vmbackupsize}} -Unique #| ConvertTo-HTML -Fragment
    $bodyJobSizeBk = $bodyJobSizeBk + $bodyJobSizeBkt | ConvertTo-HTML -Fragment
    $bodyJobSizeBk = $subHead01 + “Backup Job Size” + $subHead02 + $bodyJobSizeBk
    }

    }

    Reply
  15. wouterlenaerts

    I think we recently ran into a gap that doesn’t seem covered by the report and totally slipped our attention. We learned that if an agent ran fine in the past but is now not running at all for some reason, we would not notice because the last backup was successful.
    To cover for this we adjusted the code a little to notify us in RED when an agent has not created new recovery points for x amount of days. Also created a “warning level threshold”. If you are interested I would be willing to share my code but I am sure you cane code much better than me. 🙂
    It would be very nice to have this integrated in your code.

    Reply
    1. Massou JM

      hi Wouterlenaerts, I ran into the same gap few month ago, i work on a new array for agents with that sort of information but that it is so badly coded by mine that i don’t share it. I would be please to review your code and compare it with mine.

      Reply
      1. wouterlenaerts

        The code I adjusted was from version 9.0.3 of your script. I adjusted the following section.
        —————————
        # Get Successful Endpoint Backup Sessions
        $bodySessSuccEp = @()
        If ($showSuccessEp) {
        If ($successSessionsEp.count -gt 0) {
        If ($onlyLastEp) {
        $headerSuccEp = “Successful Endpoint Backup Jobs”
        } Else {
        $headerSuccEp = “Successful Endpoint Backup Sessions”
        }
        Foreach($job in $allJobsEp) {
        $bodySessSuccEp += $successSessionsEp | ?{$_.JobId -eq $job.Id} | Select @{Name=”Job Name”; Expression = {$job.Name}},
        @{Name=”Start Time”; Expression = {$_.CreationTime}},
        @{Name=”Stop Time”; Expression = { if($_.EndTime -lt (get-date).AddDays(-7)){“#fontred” + $_.EndTime + “fontred#”} else {$_.EndTime} }},
        @{Name=”Duration (HH:MM:SS)”; Expression = {Get-Duration -ts $(New-TimeSpan $_.CreationTime $_.EndTime)}},
        @{Name=”Last run”; Expression = {if($_.EndTime -lt (get-date).AddDays(-7)){“#fontred” + “Not for >7 days” + “fontred#”} elseif($_.EndTime -lt (get-date).AddDays(-2)){“#fontorange ” + “Not for >2 days” + ” fontorange#”} else {“OK”}}},

        Result
        }
        $bodySessSuccEp = $bodySessSuccEp | Sort-Object “Start Time” | ConvertTo-HTML -Fragment
        $bodySessSuccEp = $bodySessSuccEp -replace “#fontred”,””
        $bodySessSuccEp = $bodySessSuccEp -replace “fontred#”,””
        $bodySessSuccEp = $bodySessSuccEp -replace “#fontorange”,””
        $bodySessSuccEp = $bodySessSuccEp -replace “fontorange#”,””
        $bodySessSuccEp = $subHead01 + $headerSuccEp + $subHead02 + $bodySessSuccEp
        }
        }

  16. Harald G.

    Hi Shawn,
    I use your report since many month. Great idea and great implementing.
    With the version 9.53 I have a problem that the cloud provider is seen as windows service. When I only execute the commandline from the function “Get-VeeamServices” I get only the visible Veeam Services in Windows. I don’t understand where the cloud provider comes from?
    The problem is that the cloud repo and the cloud provider appear as “unknown” and therefore as warning (yellow).

    Do you have a suggestion to avoid or exclude the cloud components from report?

    Thanks for spending your time with my problems

    Harald

    Reply
    1. smasterson Post author

      The Get-VeeamServices function is going to run for each server returned from Get-VeeamWinServers. Creating an exclusion in Get-VeeamWinServers should stop it from being passed to Get-VeeamServices.

      Reply
  17. Pingback: Newsletter: March 3, 2018 – Notes from MWhite

  18. Sam

    Hi Shawn

    Is there a way to make the report show the restore points for each backed up VM or the backup and copy jobs?

    Regards, Sam

    Reply
  19. Sam S

    Hi Shawn, can you please advise on how to change the status of a repository so it reports warning / critical based on a different threshold to other repositories?

    Reply
  20. S00lfly

    Hello,

    Are “File to Tape” job supported ?
    When I start the script, there is no report for File to Tape backup jobs.

    If it is not implemented in your script, do you think I could do it by mylself ?
    Any idea about the function in Veeam Snapin powershell I should use for that ?

    Best Regards and thanks in advance 🙂

    Reply
  21. Chris

    Thanks for the great Script it’s working great.

    I have a situation where We have some Windows Agents used on a VM. So the Report shows VMs with No successful Backups within RPO shows the VM as not having a backup. But we do show the backup in the Agent jobs. So really the VM has been backed up in the RPO. Can you have the script check for the VM name in both the Agent and the Backup job info?

    Reply
    1. smasterson Post author

      The VM’s with No Successful Backups section is only looking at VM backups. To clean it up (in this odd scenario), just exclude the VM via $excludeVMs.

      Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s