Today just a quick post about how Powershell can help you change the VM attribute option in Veeam Backup & Replication. Imaging that you have 20 backup jobs and you want or need to change the VM attribute settings. You can do this for every job with 10 mouse clicks or you can do it in five seconds by running the script from this post.
This is the setting I am talking about from the GUI:
When you change the “Notes” value to some custom field in you environment, the script will apply this setting for you.
if((Get-PSSnapin -Name VeeamPSSnapIn -ErrorAction SilentlyContinue) -eq $null){ Add-PSSnapin "VeeamPSSnapIn" } $vbrserver = Get-VBRServer | Where {$_.Type -eq "VC"} Foreach($vbrjob in (Get-VBRJob)){ $options = $vbrjob.GetOptions() $options.VmAttributeName = "Notes" $options.SetResultsToVmNotes = $true $vbrjob.SetOptions($options) }
The first three lines of code checked if the VeeamPSSnapIn is loaded, if this is not the case it will be loaded via the Add-PSSnapin.
- The backup options will be loaded via the .GetOptions() method.
- VmAttibuteName is the value which you normally enter in the attribute field.
- SetResultsToVmNotes is the checkbox to enable this setting.
- via .SetOptions() method you can apply the new settings.
It does not look like this method is available in v7. Do you know of another way?
$options.SetResultsToVmNotes = $true
Property ‘SetResultsToVmNotes’ cannot be found on this object; make sure it exists and is settable.
At line:1 char:6
+ $options. <<<< SetResultsToVmNotes = $true
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertyAssignmentException
Hi Omarr, I have created a new script to enable the VM Notes option with Powershell. You can find the script here: https://ict-freak.nl/2014/07/09/veeam-v7-how-to-change-the-job-notification-settings-with-powershell/
Thanks