How to automate Veeam Backup and Replication Global Exclusion Lists

In Veeam Backup and Replication Version 12 a global VM exclusion list was introduced. VMs added to this list are excluded from processing in all jobs.

1. Administer the Global VM Exclusion list via the GUI in VBR 12

Up to now the only way to get VMs into or out of this list was via the GUI.

In V12 you get there with “Hamburger menu” on the upper left corner --> VM Exclusions

Then this dialog appears, and you can administer the global exclusion list via the GUI.

2. Administer the Global VM Exclusion List and the Global Malware exclusion list via the GUI in VBR 12.1

With the coming version 12.1 there will be some changes.

First will there be an additional exclusion list. You have one “Global VM Exclusions” list and one “Global Malware Exclusions” list.

You get there with “Hamburger menu” on the upper left corner --> Global Exclusions --> select one of the two exclusions lists.

Then this dialog appears (it looks the same for both exclusions lists except the window title), and you can administer the global exclusion lists via the GUI.

The second new feature is that you can administer both exclusions lists via PowerShell commands. We will have a look how to achieve this…

3. Administer the Global VM Exclusion List via PowerShell in VBR 12.1

First you have to get one or more VM definitions with the commence Find-VBRViEntity and save the results in a variable.

PS D:\scripts\Powershell> $VM = Find-VBRViEntity -Name Test-VM-1,Test-VM-2

The content of the variable looks like this.

PS D:\scripts\Powershell> $VM

ConnHostId             : 5abc7839-46ha-4gc4-9863-752ej2w43da9
Type                   : Vm
Reference              : vm-12345678
Id                     : 5abc7839-46ha-4gc4-9863-752ej2w43da9_vm-12345678
Name                   : Test-VM-1
Path                   : 10.20.30.40\CLUSTER1\TEST-AND-PLAY\Test-VM-1
VmHostName             : testhost-01.testzone.de
VmFolderName           : Windows
IsLegacyFaultTolerance : False
FaultToleranceType     : None
GuestInfo              : Veeam.Backup.Model.CGuestInfo
Uuid                   : 1234b5d4-fc65-fgk7-3r06-8420at860u83
PowerState             : PoweredOn
IsTemplate             : False
ProvisionedSize        : 449532919808
UsedSize               : 440980733952
Platform               : EVmware
RawReference           : vm-12345678
IsInfected             : False

ConnHostId             : 5abc7839-46ha-4gc4-9863-752ej2w43db0
Type                   : Vm
Reference              : vm-23456789
Id                     : 5abc7839-46ha-4gc4-9863-752ej2w43db0_ vm-23456789
Name                   : Test-VM-2
Path                   : 10.20.30.40\CLUSTER1\TEST-AND-PLAY\Test-VM-2
VmHostName             : testhost-02.testzone.de
VmFolderName           : Linux
IsLegacyFaultTolerance : False
FaultToleranceType     : None
GuestInfo              : Veeam.Backup.Model.CGuestInfo
Uuid                   : 471sff2h-7rc7-25z6-8328-38dch17k7419
PowerState             : PoweredOn
IsTemplate             : False
ProvisionedSize        : 398932836352
UsedSize               : 180006944768
Platform               : EVmware
RawReference           : vm-23456789
IsInfected             : False 

Now you can add one or all VMs in the variable to the Global VM Exclusions list with the command Add-VBRVMExclusion. To add a specific VM user the index of the VM inside the variable – e.g. $VM[0] for Test-VM-1

PS D:\scripts\Powershell> Add-VBRVMExclusion -Entity $VM

Platform Note Name       Id                                  
-------- ---- ----       --                                  
  VMWare      Test-VM-1  1234b5d4-fc65-fgk7-3r06-8420at860u83

You can list the content of the Global VM Exclusion List with the command Get-VBRVMExclusion. Write the results of this command to a variable to use it to remove VMs from the Global VM Exclusion list.

PS D:\scripts\Powershell> Get-VBRVMExclusion 

Platform Note Name            Id                                  
-------- ---- ----            --                                  
  VMWare      Test-VM-1       1234b5d4-fc65-fgk7-3r06-8420at860u83
  VMWare      Test-VM-2       471sff2h-7rc7-25z6-8328-38dch17k7419 

Use the results of the former command to remove VMs from the Global VM Exclusions list.

PS D:\scripts\Powershell> Remove-VBRVMExclusion -Exclusion $Exc[0]

List the content of the list to check that the VM was removed.

PS D:\scripts\Powershell> Get-VBRVMExclusion 

Platform Note Name            Id                                  
-------- ---- ----            --                                  
  VMWare      Test-VM-2       471sff2h-7rc7-25z6-8328-38dch17k7419 

4. Administer the Global Malware Exclusion List via PowerShell in VBR 12.1

You can administer the Global Malware Exclusion list with the exact same logic, just use these three commands.

Add-VBRMalwareDetectionExclusion 
Get-VBRMalwareDetectionExclusion 
Remove-VBRMalwareDetectionExclusion

Last updated