Veeam exclude disks using PowerShell

AvatarPosted by

When you have multiple jobs with many VMs it’s a boring task to change all the disk exclusions by hand. That’s why VEEAM have made a nice PowerShell module to automate this boring tasks.

Excluded disks are displayed with numbers, the numbers in Hyper-V are different (because of the IDE disks) then how the numbers are showed in VMWare.

Since Veeam 9.5 Update 4 the diskfilter mechanism in Veeam is changed.

Now we can report both.. SCSI Controller id and the Keynumber as we known earlier.
This means the PowerShell CMDLets also Changed.

Report diskfilter:

Change diskfilter:

Change diskfilter before 9.5 Update 4

See the current excluded disks and the numbers with this script (Run as Administrator):

Change the disks exclusions with PowerShell (Run as Administrator):

Comments are welcome.

6 comments

  1. Nice scripts. You also have a script to see the current excluded disks on all VM’s and export to .csv for 9.5 Update 4 and higher?

    When I run the pre 9.5u4 script I get this as .csv output:

    #TYPE Selected.Veeam.Backup.Core.CObjectInJob
    Name,”DiskFilter”
    SRV0032,”Veeam.Backup.Core.CDiskFilter”
    SRV0050,”Veeam.Backup.Core.CDiskFilter”
    SRV0056,”Veeam.Backup.Core.CDiskFilter”
    SRV0117,”Veeam.Backup.Core.CDiskFilter”
    SRV0120,”Veeam.Backup.Core.CDiskFilter”

    Thx in advance,
    Ali

    1. Hello Ali,

      You need to expand the diskfilter object.
      A way to do this is with a expression like: select name, @{label=”Diskfilter”;expression={$_.diskfilter.disks}}
      So you can go deeper in the object this way: $_.diskfilter.disks.keys

      Hope this helped.

  2. Hello Rob. Do you have any advise on how to explore the undocumented Veeam Powershell object model? I have a use case for example where I need to delete restore point files from a repository, my hunch is that there is either static or instance methods to do this, but am not sure where to look.

    1. Hello Eugene,
      Never did that before. But the Remove-VBRRestorePoint is not suitable?
      What are you trying to archive? There are a lot of methods available with the “get-vbrrestorepoint | gm” commandlet..

      Greetings,
      Rob

      1. Yes I wasn’t able to get anyone on forums.veeam.com to suggest how, but I need to delete the file which stores a restore point. It is on a repository of a deduplication appliance which does not have any methods for interacting with the items in the deduplication appliance. Veeam can interact with these files via the Files pane. But I have thousands of files to delete, and am still searching.

        The objects returned from get-vbrrestorepoint do have delete() methods, but a forum member told me this is “delete from configuration database” where what i need is to delete the file. I can get the file name and metadata of a restore point with the .findStorage() method of an object returned by get-vbrrestore point. I feel so close 🙂

Leave a Reply

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