Veeam v9 – My Veeam Report v9.5.1

Find the latest version here.

My Veeam Report has been updated once again (finally!). Along with the typical tweaks and additions we are adding some color to make viewing the report a bit easier.

What’s New

The biggest addition to the report this time around is the report and section headers are now colored depending on the results. Also added is a result displayed in the email subject. We all know looking at the same report everyday gets tedious and it is easy to miss something important. Now you can look at a glance and see if you need to drill down further, or move on to bigger things (like finishing that cup of coffee).

Another nice addition is a section that will highlight if a VM is being backed up by multiple jobs. This can be a common mistake in environments with lots of VMs and/or admins.

A few minor additions include being able to send email via SSL/TLS, append date/time to email subject and also added a few more details to some sections. See the VersionInfo region for all updates.

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.

45 thoughts on “Veeam v9 – My Veeam Report v9.5.1

  1. Oskar Gawron

    Hi. Great tool. Nice update. When i deployed it at a VBR where there is production license for VMs, but trial for agents than i got Failed messages on the License/Support Renewal Date. The previous version didn’t had this problem. The only thing I’ve changed is the amount of days in the configuration for licenses.

    Reply
    1. smasterson Post author

      Hi Oscar
      Nothing has changed regarding the license check. Have you by chance run the script on a console install vs on the VBR server itself? The most common reason for the failed messages is that the WMI query failed between the console system and the VBR server. Essentially on a console install the script attempts to connect to the VBR server via WMI in order to read the registry entry that holds the license info. The biggest issue with using this method is that WMI can likely be blocked by firewalls.

      Reply
  2. Dariusz

    Hi Shawn,

    when I try to execute new script (old 9.0.3 is working fine) I receive following error:
    .\MyVeeamReport_24h.ps1 : The script ‘MyVeeamReport_24h.ps1’ cannot be run because the following snap-ins that are specified by the “#requires” statements of the script are missing: VeeamPSSnapin.
    At line:1 char:1
    + .\MyVeeamReport_24h.ps1
    + ~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : ResourceUnavailable: (MyVeeamReport_24h.ps1:String) [], ScriptRequiresException
    + FullyQualifiedErrorId : ScriptRequiresMissingPSSnapIns

    Reply
    1. smasterson Post author

      Good catch, my bad. You can safely remove the second line to clear the issue.
      #requires -PSSnapin VeeamPSSnapin

      Worked for me as I preload the snapin in my profile.
      I updated the gist as well.

      Thanks!

      Reply
  3. gifkeeper

    Hello Shawn!
    I have an error when starting the script.

    Get-Date : Cannot bind parameter ‘Date’ to the target. Exception setting “Date”: “Object reference not set to an
    instance of an object.”
    At C:\temp\MyVeeamReport.ps1:1260 char:23
    + If ((Get-Date $vmtask.Progress.StartTime) -ge (Get-Date $vms[$vmtask.Inf …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : WriteError: (:) [Get-Date], ParameterBindingException
    + FullyQualifiedErrorId : ParameterBindingFailed,Microsoft.PowerShell.Commands.GetDateCommand

    Get-Date : Cannot bind parameter ‘Date’ to the target. Exception setting “Date”: “Object reference not set to an
    instance of an object.”
    At C:\temp\MyVeeamReport.ps1:1260 char:23
    + If ((Get-Date $vmtask.Progress.StartTime) -ge (Get-Date $vms[$vmtask.Inf …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : WriteError: (:) [Get-Date], ParameterBindingException
    + FullyQualifiedErrorId : ParameterBindingFailed,Microsoft.PowerShell.Commands.GetDateCommand

    Reply
    1. smasterson Post author

      Hmmm…it looks as though you have a task or two that do not have a valid Start Time.
      If you could, shoot me an email (smasterson gmail.com) and I can follow up better with troubleshooting this issue with you.

      Reply
    2. troy

      Hi there, I am experiencing the same issue:

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

      Is it possible to have something for capacity planning?

      Reply
  4. Sam

    Shawn

    Thanks for the amazing report. I am having an issue where no email gets sent. The old version of your report works fine, but the identical email settings fail to generate an email.

    I’ve tried this with Office 365 and On Prem Exchange 2013.

    Reply
  5. Remi Hornung

    Hello Shawn
    I’ve upgraded the script version to the newest version. However now the warnings error boxes are not longer fully colored instead only the letters are. Is there a way for the box to be color indicated instead of the text?

    Reply
    1. smasterson Post author

      Hi Remi
      This was part of the HTML change moving the colored cells to the section headers themselves giving a better overview of the results of the section. Having both the section headers and the results cells colored didn’t look right and made the report very busy looking.
      I’d recommend picking and choosing your sections carefully as some are more descriptive than others. For example using Succeeded and Warning/Failure sections as opposed to the All sessions/tasks sections.

      Reply
  6. david

    Is there a way to exclude a repo? We have a netapp repo that is showing up that we dont use and it is causing a warning for our repo section.

    Thanks

    Reply
  7. Remi Hornung

    Hello Shawn

    I was wondering if it’s possible to remove the [Failed] – [Warning] From the header of the E-mail?

    Reply
  8. MIt

    Hey
    Great script and very useful. With VMs it’s working ok, but with Agent Backup Sessions or jobs I would like to have Processed, Data Read and Transferred (GB) amounts. I tried to edit the script and was able to get those but only with 0 GB. Can you help? thanks

    Reply
  9. DaHe

    Hi smarterson
    Yesterday I have updated to Veeam B & R 9.5 Update 3 and now every VM is listed as “VMs with no Successful Backups within RPO”. If I run the Script in the ISE Editor I get the following error for each VM:
    Get-Date : Cannot bind parameter ‘Date’ to the target. Exception setting “Date”: “Object reference not set to an instance of an object.”
    At C:\Service\Veeam\Scripts\MyVeeamReport.ps1:1265 char:23
    + If ((Get-Date $vmtask.Progress.StartTime) -ge (Get-Date $vms[$vmtask.Inf …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : WriteError: (:) [Get-Date], ParameterBindingException
    + FullyQualifiedErrorId : ParameterBindingFailed,Microsoft.PowerShell.Commands.GetDateCommand

    Before Veeam Update 9.5 Update 3 everything worked fine. What could be wrong with this?
    Thanks for a reply.

    Reply
  10. Giovanni Golinelli

    Hi Shawn, I’ve the same issue:
    Get-Date : Cannot bind parameter ‘Date’ to the target. Exception setting “Date”: “Object reference not set to an instance of an object.”
    At C:\Install\MyVeeamReport_9_5_1.ps1:1264 char:23
    + If ((Get-Date $vmtask.Progress.StartTime) -ge (Get-Date $vms[$vmtask.Inf …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : WriteError: (:) [Get-Date], ParameterBindingException
    + FullyQualifiedErrorId : ParameterBindingFailed,Microsoft.PowerShell.Commands.GetDateCommand

    This happens after 9.5 U3: any idea?

    TIA

    Reply
    1. DaHe

      Found the solution:
      Veeam has changed the names of the progress attributes from StartTime to StartTimeLocal (or Utc) and from StopTime to StopTimeLocal:

      PS C:\Windows\system32> $vmtask.Progress


      StartTimeLocal : 20.12.2017 23:39:02
      StopTimeLocal : 20.12.2017 23:53:17
      StartTimeUtc : 20.12.2017 22:39:02
      StopTimeUtc : 20.12.2017 22:53:17

      So I have changed the script as follows:

      If ($vbrtasksessions) {
      Foreach ($vmtask in $vbrtasksessions) {
      If($vms.ContainsKey($vmtask.Info.ObjectId)) {
      If ((Get-Date $vmtask.Progress.StartTimeLocal) -ge (Get-Date $vms[$vmtask.Info.ObjectId][5])) {
      If ($vmtask.Status -eq “Success”) {
      $vms[$vmtask.Info.ObjectId][0]=$vmtask.Status
      $vms[$vmtask.Info.ObjectId][5]=$vmtask.Progress.StartTimeLocal
      $vms[$vmtask.Info.ObjectId][6]=$vmtask.Progress.StopTimeLocal
      $vms[$vmtask.Info.ObjectId][7]=””
      } ElseIf ($vms[$vmtask.Info.ObjectId][0] -ne “Success”) {
      $vms[$vmtask.Info.ObjectId][0]=$vmtask.Status
      $vms[$vmtask.Info.ObjectId][5]=$vmtask.Progress.StartTimeLocal
      $vms[$vmtask.Info.ObjectId][6]=$vmtask.Progress.StopTimeLocal
      $vms[$vmtask.Info.ObjectId][7]=($vmtask.GetDetails()).Replace(“”,”ZZbrZZ”)
      }
      } ElseIf ($vms[$vmtask.Info.ObjectId][0] -match “Warning|Failed” -and $vmtask.Status -eq “Success”) {
      $vms[$vmtask.Info.ObjectId][0]=$vmtask.Status
      $vms[$vmtask.Info.ObjectId][5]=$vmtask.Progress.StartTimeLocal
      $vms[$vmtask.Info.ObjectId][6]=$vmtask.Progress.StopTimeLocal
      $vms[$vmtask.Info.ObjectId][7]=””
      }
      }
      }
      }

      This now works as expected.

      Reply
  11. Julien

    Hi,
    First I want to thank you for your work, this script is very usefull for our team!
    However, I’ve an issue with the script as it doesn’t show anything in the VM Backup Protection Summary. Every field show 0 and Nothing in %Protected. Do you have an idea? The rest of the script works perfectly.

    Reply
          1. smasterson Post author

            That’s the issue – script is written for vSphere.
            It probably wouldn’t be hard to adapt for Hyper-V but I don’t have an environment myself to work with…

          2. Julien

            Ok it explains a lot. I can confirm you that everything else in the report is working perfectly fine in Hyper-V environment. Just the “VM Backup Protection Summary” shows no info.

  12. Fahmi Azhar

    Hello,

    First of all , many thanks for sharign such a beautiful script to make our life easier.
    Bu I am not gettign any for Agent based backups in my veeam server. I have set everything to true. not sure whats missing.any help

    # Show Agent Backup Session Summary
    $showSummaryEp = $true
    # Show Agent Backup Job Status
    $showJobsEp = $true
    # Show Agent Backup Job Size (total)
    $showBackupSizeEp = $true
    # Show all Agent Backup Sessions within time frame ($reportMode)
    $showAllSessEp = $true
    # Show Running Agent Backup jobs
    $showRunningEp = $true
    # Show Agent Backup Sessions w/Warnings or Failures within time frame ($reportMode)
    $showWarnFailEp = $true
    # Show Successful Agent Backup Sessions within time frame ($reportMode)
    $showSuccessEp = $true
    # Only show last session for each Agent Backup Job
    $onlyLastEp = $true
    # Only report on the following Agent Backup Job(s)
    #$epbJob = @(“Agent Backup Job 1″,”Agent Backup Job 3″,”Agent Backup Job *”)
    $epbJob = @(“”)

    Reply
      1. smasterson Post author

        When the script was written ‘Agents’ were free and unmanaged, that is what is captured here. When Veeam introduced the managed agents they did not provide ways to report on them via PowerShell. You’ll likely have to wait for v10 for that to be made available.

        Reply
  13. qelpdWORDPRESS18!

    Hello , I tried the script but I got the error it could not connect to the VBR server . I modified the variable setting it to either the server name or the IP address .

    Reply
  14. Lazo

    Many thanks for this script. Anyone come across this issues. The only way around it for me was to exclude it form the script.

    Exception calling “SyncSpaceInfoToDb” with “2” argument(s): “Failed to establish connection to the service provider”
    At C:\MyVeeamReport.ps1:1009 char:7
    + [Veeam.Backup.Core.CBackupRepositoryEx]::SyncSpaceInfoToDb($r, …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : Exception

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *