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.

160 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.

        Reply
      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. 🙁

        Reply
  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?

        Reply
          1. 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.

          2. 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

          3. 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.

      2. Jeff Baumann

        Hi! Just started using your script! It works great, Thanks much! I am however having an issue excluding systems.

        I’ve tried multiple versions of this, but it still doesn’t exclude them from the report

        $showProtectedVMs = $true
        # Exclude VMs from Missing and Successful Backups sections
        # $excludevms = @(“vm1″,”vm2″,”*_replica”)
        $excludeVMs = @(“_replica”,”Z-VRA”,”test”,”image”*,”base”)

        i’ve also tried

        $showProtectedVMs = $true
        # Exclude VMs from Missing and Successful Backups sections
        # $excludevms = @(“vm1″,”vm2″,”*_replica”)
        $excludeVMs = @(“*_replica*”,”*Z-VRA*”,”*test*”,”*image*”*,”*base*”)

        Any help with this would be great!

        Thanks
        Jeff

        Reply
  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.

        Reply
  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
        }
        }

        Reply
  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
  22. Cameron

    Great work as always, thanks!

    Is there a way to exclude backup jobs that failed on their first attempt, but succeeded on subsequent attempts from the report?
    It’s frustrating to see a ‘failed’ report when said jobs were later successful.

    Reply
    1. smasterson Post author

      Hello
      You can utilize the following to only show the last session ran for each job
      # Only show last Session for each Backup Job
      $onlyLastBk = $true

      Reply
  23. Nick L

    Hi Shawn, we have an automated report engine that needs us to feed in report data as csv format. I love the comprehensive report, but trying to Export-Csv as a ‘single table’ with all monthly backup jobs and their stats (i can then pick and choose what i want). Im getting in way too deep trying to piece all the separate bits from your ‘My Veeam Report’ where I’m sure there is an nice way to do it all in one export- simply, any ideas? (I only need backup jobs, vm’s, success, restore points). Thanks!

    Reply
  24. Heath Mason

    Shawn,

    Is there a way to include what repository a virtual was backed up to? We have multiple repositories and only some are replicated offsite (production only). I’m being asked to show what repository a virtual is backed up to so we can prove that it is being sent off to our DR site. Thanks.

    Reply
  25. Derek Bannard

    I made a few additions to the script to allow for command line options for username, password and port options.
    Also tweaked the script to automatically pull the VBR exe file from the registry, so no need to hard code it anymore.
    The script will now output report “htm” files with the server name as well.

    Added and changed bit below.

    Enjoy!

    Place above “#region User-Variables”.

    param(
    [Parameter(Mandatory=$true)][string]$Server,
    [int]$Port,
    [string]$User,
    [string]$Password
    )

    if(!$Port)
    {
    # Sets default port if one was not specified.
    $vbrPort = 9392
    }


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


    # Location of Veeam executable (Veeam.Backup.Shell.exe)
    $veeamExePath = ((Get-ItemProperty -path "HKLM:\SOFTWARE\Veeam\Veeam Backup and Replication").CorePath + "Veeam.Backup.Shell.exe")


    # Connect to VBR server
    $OpenConnection = (Get-VBRServerSession).Server
    If ($OpenConnection -ne $vbrServer){
    Disconnect-VBRServer
    Try
    {
    if($User){
    # Username was specified. Use it.
    Connect-VBRServer -Server $vbrServer -Port $vbrPort -User $User -Password $Password -Timeout 30 -ErrorAction Stop
    } else {
    # No username specified. Use current user to connect.
    Connect-VBRServer -Server $vbrServer -Port $vbrPort -ErrorAction Stop
    }
    }
    Catch
    {
    #Can't connect to Veeam.
    Write-Host "Unable to connect to VBR server $vbrServer on $vbrPort"-ForegroundColor Red
    exit
    }
    }

    Reply
      1. Martin

        OK, thanks. So can I exclude VM with description ?
        I have many, many VM an many DC, folders, etc…. who don’t have backup and who will never have backup

        Reply
  26. schedlbauerm

    Hi,

    I get the following errors:

    What may cause this ?

    Thanks !

    PS C:\scripts> .\MyVeeamReport-Daily.ps1
    At C:\scripts\MyVeeamReport-Daily.ps1:1241 char:97
    + … ForEach {[regex]::escape($_)}) -join “|”) + ‘)$’) -replace “\\\*”, ” …
    + ~~~~~~~~~~~~~~~~~~~~~
    Expressions are only allowed as the first element of a pipeline.
    At C:\scripts\MyVeeamReport-Daily.ps1:1241 char:118
    + … rEach {[regex]::escape($_)}) -join “|”) + ‘)$’) -replace “\\\*”, “.*”
    + ~~~~~~~~~~~
    Unexpected token ‘\\\*”, “.*”
    $excludefolder_regex = (‘(?i)^(‘ + (($script:excludeFolder | ForEach
    {[regex]::escape($_)}) -join “‘ in expression or statement.
    At C:\scripts\MyVeeamReport-Daily.ps1:1242 char:103
    + … ForEach {[regex]::escape($_)}) -join “|”) + ‘)$’) -replace “\\\*”, ” …
    + ~~~~~~~~~~~~~~~~~~~~~
    Expressions are only allowed as the first element of a pipeline.
    At C:\scripts\MyVeeamReport-Daily.ps1:1242 char:124
    + … rEach {[regex]::escape($_)}) -join “|”) + ‘)$’) -replace “\\\*”, “.*”
    + ~~~~~~~~~~~
    Unexpected token ‘\\\*”, “.*”
    $excludedc_regex = (‘(?i)^(‘ + (($script:excludeDC | ForEach
    {[regex]::escape($_)}) -join “‘ in expression or statement.
    At C:\scripts\MyVeeamReport-Daily.ps1:1243 char:95
    + … ForEach {[regex]::escape($_)}) -join “|”) + ‘)$’) -replace “\\\*”, ” …
    + ~~~~~~~~~~~~~~~~~~~~~
    Expressions are only allowed as the first element of a pipeline.
    At C:\scripts\MyVeeamReport-Daily.ps1:1243 char:116
    + … rEach {[regex]::escape($_)}) -join “|”) + ‘)$’) -replace “\\\*”, “.*”
    + ~~~~~~~~~~~
    Unexpected token ‘\\\*”, “.*”

    Reply
  27. Patrick Pletscher

    Hello

    I tired this report for the first time, and its just perfect to get an health overview of the Veeam backup infrastructure.

    I am using Veeam to orchestrate NetApp Storage SnapShots. We are creating every 3rd hour a stroage snapshot of the datastores.
    Now in the “VM Backup Protection Summary ” report all my 170 VM’s are shown as fully protected. But actually only about 25 VM’s are currently backuped by a backup job, since we are just migration to Veeam.
    So my question, is there a way to exclude storage snapshots from beeing shown the VM’s as fully protected?
    Because we dont see storage snapshots as backup. So I would like to only see the VM’s which are backup by a backup job in the summery.

    Thanks

    Reply
  28. Heath Mason

    Started getting the error “WARNING: Sequence contains no elements” when executing the script. Curious if anyone else has seen this.

    Reply
  29. hatemben

    Hi, it’s really great this script, but I’m looking for how to generate a report by date and not number of hours. Someone did that ? thx for your help

    Reply
  30. Ramesh

    Hi, First of all Thanks for creating the extensive report script. It was very useful & informative.

    Now let me come to the challenges that im facing.

    1. Veeam services Section – I’M getting unable to connect error and the status shows unknown. Not sure what could be the problem as im able to RDP to the servers fine from the Veeam server.

    2. License/Support Renewal Date – The expiry & days remaining is showing as WMI connection failed.

    Can you advise me on how to get these issue fixed.

    Reply
  31. MartinE

    Many thanks for the excellent script. Very useful. As a possible future enhancement suggestion, it would be useful to be able to exclude selected vCenter Clusters from the report. We have a development cluster which we don’t back up.

    Reply
  32. Pin Pin Poola

    Thanks for maintaining this great script. Would it be possible for you to add a “Last Run” date/time for each replication job in the Replication Job Status section? Many Thanks. PinPin.

    Reply
  33. Pin Pin Poola

    I am also getting the following error:

    Attempted to divide by zero.
    At C:\VeeamReport\MyVeeamReport-RepOnly.ps1:1119 char:9
    + $objoutput = New-Object -TypeName PSObject -Property @{
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [], RuntimeException
    + FullyQualifiedErrorId : RuntimeException

    VBR v9.5.0.1922
    MVR v9.5.3
    PowerShell v4.0 (Windows 2012 R2 Server)

    Any ideas?

    Thanks.
    PinPin

    Reply
  34. opedro

    Hi, nice work on this script
    i need some help to the exclude feature.
    i try to exclude some “job names” but dont work can someone give me one option.
    just try to add exclude Host ( hyperV) but the report allways show this jobs name and all the vms on them.

    Reply
  35. Dan Christensen

    Nice script first off all.
    1. I would like to exclude some repositories from “Repository Details”. We use Cloud Connect for some jobs and we do not have permissions to see storage space available, nor do I need to “monitor” them. Fixed it this way:
    Change line 4115: ElseIf ($_.StorageTotal -eq 0) {“NoData”}
    Change line 4125: } ElseIf ($arrRepo.status -match “OK|NoData”) {
    2. I would like to exclude servers from the “Veeam Services”. Our repository servers is not in the domain for security reasons. Since you can’t make Get-Service without putting creds in the script, i don’t se other ways then to exclude them. Jobs would have failed anyways if the repository service was not running. And comes back with Unknown for Cloud Connect repos too.

    Reply
  36. Steven

    Thank you very much for the report. I was looking for such report for sometime now. I managed to download and customized to only 1 page that we needed – “Backup Task” and comment those we don’t need (it run in less than 15 secs). This is good enough for us. Thank you once again.

    Reply
  37. sandsturm

    Hi
    I use you script for a while now and it works perfect. Have you already tested the script with the newest Veeam version 9.5 update 4? Does it work with this version?

    thx

    Reply
  38. Matias

    HI, i need a report Backup TAPE exactly as the email send by the system. I have around 13 veeam backup server, and i trying to get a powershell that get the information for the last tape backup for every server and create a HTML with that information exactly the same report send me each server separatly I wont to run only one script that connect each server and get that information and put one under one… Or just an script that create the report HTML for the last tape job run….

    Reply
  39. Matias Encina

    HI is possible from 1 veeam server connecto to other veeam a get same report for each server only in 1 HTML Report (Email + File)?

    Reply
  40. Josh

    Thank you for the script, is there a way to add Physical server backups (Windows, Linux) to the script?

    Reply
  41. JohnQ

    Shawn, thanks for sharing your scripts. Have you tested under Veeam Update 4. Do you know why the script might not pick up new Vm jobs / backups automatically?

    Reply
    1. smasterson Post author

      Hi John
      Unfortunately I have not had a chance to install Update 4 as of yet. At this point I am only running Veeam in my homelab and it has become a bit of a lower priority…:-(
      As far as not picking up new jobs, the only thing I am aware of is the lack of reporting on ‘licensed/managed agent’ jobs. I do believe PowerShell access to these jobs was added in U4.
      With the new Community license I am hoping to take a look when I can find the time…no promises.

      –shawn

      Reply
  42. LarryL

    Shawn – thanks for the script. I do have an issue when running this in our environment: We have 4 ESX hosts – 2 are for productions VMs and 2 are for our DR site. When any of the “Find-VBRViEntity” statements are reached, I receive “WARNING: Failed to login to “(IP address of DR ESX server)” by SOAP, port 443, user “root”, proxy srv: port:0

    I suspect this is because the DR server does not have a license associated with it right now (our vendor says that we will move the license over from production in the event we need to bring up the DR site). The DR servers are associated with some replication jobs, so I can’t remove them from the backup infrastructure… Is there a way I could eliminate them from being contacted within this script?

    Thanks!

    Reply
  43. Petio Harizanov

    Hello Shawn,
    first i want to thank you for your magnificent work. Tell me please can i get the vm’s in a given job sorted by criteria in the output ?

    Thanks.

    Reply
  44. Roger Lightfoot

    Hi Shawn

    Love your script. It’s a critical part of our data protection. Thanks.

    Quick question – Am I right in concluding that your script does not report on Windows Agent Backups?

    Roger

    Reply
  45. Jimmy

    Id like to tell people of a discovery i made today with the report with 9.5 update 4U. is that its no longer reporting the right backup data size etc. Some jobbs were more way off then others.

    But in general its not reliable to use as a report to know that Backup Size. Anyone thats been continuing the work of this projekt?

    Reply
      1. Ty

        I’m also seeing this too. Veeam 9.5 U4
        I have notifications turned on for each backup job. For example, the notification I receive, shows my backup size by 5.3GB for a set of my VM’s, If i look at the veeam report, it shows796.439999999999 GB. Looks pretty off.

        Reply
      2. jimmyhawkin

        From what i can se is that agent data is being ignore when on latent software. Only agents on oldersoftware are included

        Reply
  46. zaki

    We have used the script for multiple servers and its working fine.

    But with one of the Veeam server , its not listing the agent jobs even though the option is enabled in the script. Could it be because the script is not designed for version 9.5.4

    Reply
  47. Pingback: Newsletter: June 8, 2019 – Notes from MWhite

    1. Nagarjun

      can some one help with agent backups? The script does not give the backup status of the agent jobs. Need help please..

      Thanks In Advance

      Reply
  48. Michael White

    Hello there, very fond of your script. Just got it going again and it seems to have an issue with 9.5 Update 4. Any chance you will be updating it. I can arrange license if that helps.

    Michael

    Reply
  49. Jimmy

    Yeh ive seen that post aswell but its not a copy paste thing to fix by that post as far as i can see it. most likly easy for someone with the Powershell understanding. But that fix is past atleast my knowlage to do. Maby some other here can help out to implement it?

    Reply
  50. James

    Crazy question, this report works great for monitoring our onsite backups. But – and it may just be me missing it – can it be pointed to the offsite backup job as well? And if so, in what Section?

    Reply
  51. Ty

    Can you help identify why the report is detecting the amount of free/total space on my Pure Storage SAN? Veeam can see my SAN and total storage.

    Pure Storage Snapshot Unknown 4 customer-bdr Pure Storage Storage 0.00 0.00 100 Warning

    Reply
    1. smasterson Post author

      The last I looked into this, via PowerShell we can see that there is a repository but there is no way to access third party integrations (via Veeam’s PowerShell snapin). Not 100% sure if this still stands but I do believe so.

      Reply
    1. smasterson Post author

      Unfortunately it does not appear that Veeam included any way to report on Managed Agents jobs/tasks with Update 4, which is of course what everyone is looking for.

      Reply
  52. Ty

    Veeam Services (Windows) shows a “unknown” status in the report for Cloud Connect.
    In Veeam, Cloud Connect is connected up correctly and copying data over the destination.
    For now i’ve commented this out of the report because it’s throwing a warning. Is there a fix for this?

    Reply
  53. Jo

    Hi, just new to this script – fails to run with…
    Get-Item : Cannot find path ‘C:\Program Files\Veeam\Backup and
    Replication\Backup\Veeam.Backup.Shell.exe’ because it does not exist

    This file doesn’t exist on the veeam server that I am running the script on.
    Am I missing something ? Thanks

    Reply
  54. Dave

    We only have standard and we are getting this error message:
    Get-VBRTapeVault : This functionality is available in the Enterprise (or higher) edition only.
    At C:\ent\util\Scripts\MyVeeamReport\MyVeeamReport.ps1:668 char:16
    + $mediaVaults = Get-VBRTapeVault
    + ~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [Get-VBRTapeVault], LicenseException
    + FullyQualifiedErrorId : System.ComponentModel.LicenseException,Veeam.Backup.PowerShell.Cmdlets.GetVBRTapeVault

    I can ignore it but I thought I would mention it.

    Reply
    1. JM

      You can customize the report by turning off items by changing the true to false, I did this so only the Backup Tasks section provides details and the rest are disabled.

      Reply
  55. JM

    Sometimes the files are too large and I need to manually compress them as zip files, anyway to do this within the script, I did not see an option to compress the file?

    Reply
    1. Daniel

      Could get it running with v10 by setting the following parameters:

      $MVRversion = “10.0.0.4461”

      If ($VeeamVersion -lt 10.0) {

      Reply
      1. Alex Bahret

        The reason this doesn’t work out of the box is $MVRversion really needs to be cast as a [version] datatype. Since it is not, running “10 -lt 9” will always return “True” as it is doing a character-by-character comparison, and “1” is less than “9”.

        The proper way to get this working again (and have it be compatible with any version of Veeam) is to change “$VeeamVersion = Get-VeeamVersion” to “[version]$VeeamVersion = Get-VeeamVersion” and change “If ($VeeamVersion -lt 9)” to “If ($VeeamVersion -lt ‘9.0.0.0’)”. That will make it work with anything version 9.0 or above.

        Reply
  56. Steve R

    Hello all, Shawn….well V10 is here and the reports I rely on no longer function; keeping fingers crossed that you’ll have time to review Shawn, and MANY THANKS!

    Reply
  57. neowarblade

    good afternoon! I really liked the script, but the percentage values of the jobs are not being displayed. can anybody help me?

    Reply
  58. PBG

    Hello,
    Monthly RPO should cover 35 days because “VMs with No Successful Backups within RPO” status generates false postive for monthly backup job.
    For exemple a Monthly Job running each first Sunday could start after more than 31 days.

    Reply
  59. Devin Ribeiro

    Seems the agent backup job doesnt work at all.
    Get-VBREPJob returns nothing and Get-VBRComputerBackupJob doesnt return the info that the script is looking for to output to the HTML. Status,Target, NextRunTime etc.

    Reply
    1. Devin Ribeiro

      Backup Copy and Agent based reporting not working on VBR 10 with latest version. Hoping this report gets updated with the new Powershell commands. Seems Veeam changed quite a bit in V10.

      Reply
  60. pariswells

    Amazing Script , anyone wondering if you need to get a yearly report ( for Auditors! ) then change line 690 $HourstoCheck = 8760 and make sure $reportMode = “Monthly”

    Reply
    1. Heath M.

      Did you try Alex B.’s recommendation? I’m able to run version 9.5.3 of the report against version 10.0.0.4461 of VBR.

      VBR v10.0.0.4461
      MVR v9.5.3

      Reply
    2. Jason N

      Hi Sean. Ran into this issue myself. I changed the “if” statement on line 1388 to “If ($VeeamVersion -lt 10)” and that skips the error message. Reporting for VMware backup jobs and retention jobs are unaffected. That should at least get you going until the next update.

      Reply
  61. John

    Veeam V10 , I got it to work, however I have 5 physical workstations that are backed up by the Veeam server and I get no data from them. (they are managed by the server)
    Any help here?

    Reply
  62. Fred

    Veeam 10 version stopped working with the script report , here is the error , any idea can help would be appreciated ~~

    PS C:\veeam_reports> C:\veeam_reports\MYVeeamReport.ps1
    Connect-VBRServer : Access to the registry key ‘HKEY_LOCAL_MACHINE\SOFTWARE\Veeam\Veeam Backup and Replication’ is denied.
    At C:\veeam_reports\MYVeeamReport.ps1:292 char:1
    + Connect-VBRServer -server $vbrServer
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [Connect-VBRServer], UnauthorizedAccessException
    + FullyQualifiedErrorId : System.UnauthorizedAccessException,Veeam.Backup.PowerShell.Cmdlets.ConnectVBRServer

    Reply
  63. samsolingen

    Is there any possibility to create the report for a specified period of time, e.g. February 2020? I could only find the hard coded amounts of days for “Monthly” reportmode, resulting in statistics for the last 720 hours.
    Any help appreciated. Thank you in advance for any ideas.

    Reply
  64. Sean Noah

    Thanks for the great work on this script. I have made some slight mods and am running it with VEEAM 10.0.04461 P2.

    The only real change was this. All the rest were just variable updates.

    Ran into error with PowerShell closing due to version difference.
    Remarked out exit command on this check.
    If ($VeeamVersion -lt 9.5) {

    Reply
  65. lior

    is there a way to get this “$showUnprotectedVMs = $true” but only for replicas?

    i need to know when i look at a vm, if he has just backups or replicas to
    is there a way?

    Reply
  66. Kenneth Petersen

    Hi Shawn Masterson
    Do you have any plans to make myveeamreport.ps1 so it will support Veeam Version 10 ?
    It’s super this script but it doesn’t work after upgrading to Veeam 10.
    However, I have found version requirements in the script and changed this variable so the report is send & received, but there are still errors on the WMI license that still fail.

    Kenneth

    Reply
  67. René de Vries

    Hello Kenneth,

    I had the same problem. After a little troubleshooting I found that Veeam does no longer use ‘expiration date’, but instead has changed is to ‘License expires’. To make the license part in the script work again, find this line in the script:
    $pattern = “expiration date\=\d{1,2}\/\d{1,2}\/\d{1,4}”
    and change it to:
    $pattern = “License expires\=\d{1,2}\/\d{1,2}\/\d{1,4}”

    Hope this helps.

    René

    Reply
  68. Stuart Little

    Hi Guys, also trying to get this working for v 10.0.1.4854

    Made the modifications you guys pointed out. Does anyone know why I’m getting this error?

    Method invocation failed because [Veeam.Backup.Core.CBackupRepository] does not contain a method named ‘GetContainer’.
    At E:\Scripts\VeeamBR_Report11.ps1:1034 char:43
    + $outputObj = Build-Object $r.Name $($r.GetHost()).Name.ToLower( …
    + ~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound

    Method invocation failed because [Veeam.Backup.Core.CBackupRepository] does not contain a method named ‘GetContainer’.
    At E:\Scripts\VeeamBR_Report11.ps1:1034 char:43
    + $outputObj = Build-Object $r.Name $($r.GetHost()).Name.ToLower( …
    + ~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound

    Method invocation failed because [Veeam.Backup.Core.CBackupRepository] does not contain a method named ‘GetContainer’.
    At E:\Scripts\VeeamBR_Report11.ps1:1083 char:54
    + … $outputObj = Build-Object $rs.Name $r.Name $($r.GetHost()).Name.T …
    + ~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound

    Reply
  69. Drobo

    Hello Marco,

    Thank you for the update for V11 especially around the calling of the PowerShell module.
    This made my report start running again.

    Thank you

    Reply
  70. Kamil Ramborosa

    Hi Shawn
    Thank you for this amazing tool, it works very well, even with version 11.
    The only problem that I have with it, is that it only shows 300 successful VM backups.
    Is there a way to change that so it shows all the VMs?

    Reply

Leave a Reply

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