PowerShell script exchange
Post Reply
Posts: 17
Liked: never
Joined: Sep 21, 2016 8:31 am
Full Name: Kristian Leth

How to add VSS Guest Credentials by vSphere Tags

Post by ksl28 »


Im trying to add a new tag to our Application-aware & Guest indexing settings, in all our Veeam jobs.
The idea is that our backup jobs are 100% tag based from VMware, and then based on tags, VSS and Guest indexing will be enabled.

Example - VM1:
Job tag: BackupJob#1
AAP Tag: Aap_Enabled
Guest Tag: Guest_Indexing_Enabled

For all our jobs, that backup tags defining the VM list to process, will be set to disabled in VSS and Guest file indexing.
If an VM is assigned the tag Aap_enabled, then AAP will then be enabled, and so on.

This is doable through the GUI, and ive managed to disable the VM tag from VSS and guest processing, but i cant seem to find a way to add the Aap_enabled & Guest_indexing_enabled tags.

Code: Select all

$AapTag = Get-Tag -Name "aap_enabled" -Category "Backup_aap_settings"
$AapEntity = Find-VBRViEntity -Name $AapTag.Name -Tags
Add-VBRViJobObject -Job $NewTagName -Entities $AapEntity
If i execute this code, the tag is added to the job & the VSS entiti list, but i only need it in the VSS entiti list.

The "best solution" ive came accross, is to remove the tag again

Code: Select all

Get-VBRJob -Name $NewTagName | Get-VBRJobObject -Name $AapEntity.name | Where-Object {$_.Type -ne "VssChild"} | Remove-VBRJobObject -Completely
But is this really the best way to do this, or have i missed something?

Post Reply

Who is online

Users browsing this forum: Google [Bot], oleg.feoktistov and 7 guests