PowerShell script exchange
Post Reply
jb303uk
Novice
Posts: 7
Liked: never
Joined: Feb 11, 2015 11:27 am
Contact:

Set-VBRJobAdvancedNotificationOptions wont work for Tape

Post by jb303uk »

Hi,
I am able to edit a Disk Job email notification with no problems but i am unable to do this for Tape Jobs, is this implemented yet?

EG This works:

Code: Select all

$JobName1 = "Disk Job X"; 
$Job1 = Get-VBRJob -Name 
$JobName1; $JobOptions1 = $Job1.GetOptions(); 
$JobOptions1.NotificationOptions.EmailNotificationAdditionalAddresses = "PS1@email.com"; 
$Job1.SetOptions($Joboptions1); 

This does not: 
$JobName2 = "Tape Job Y"; 
$Job2 = Get-VBRTapeJob -Name $JobName2; 
$JobOptions2 = $Job2.GetOptions(); 
$JobOptions2.NotificationOptions.EmailNotificationAdditionalAddresses = "PS2@email.com"; 
$Job2.SetOptions($Joboptions2); 
(I have replaced Get-VBRJob with Get-VBRTapeJob) I am running with the latest patch (8.0.0.917)

Case # 00826491
Hope someone can help!

James
pavel37
Lurker
Posts: 1
Liked: never
Joined: Jan 12, 2015 3:01 pm
Full Name: Pavel Poklad
Contact:

Re: Set-VBRJobAdvancedNotificationOptions wont work for Tape

Post by pavel37 »

Hi James,
Eventually Get-VBRTapeJob cmdlet doesn't work for Veeam B&R standard edition. In the VeeamPowerShell log file, the following entries can be found:
Error This functionality is available in the Enterprise (or higher) edition only. (System.ComponentModel.LicenseException).
veremin
Product Manager
Posts: 20407
Liked: 2299 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Set-VBRJobAdvancedNotificationOptions wont work for Tape

Post by veremin »

Tapes jobs are editable via either Set-VBRFileToTapeJob or Set-VBRBackupToTapeJob. Currently, there is no way to change notification settings, using the said commandlets.

So, in order to achieve your goal, you can utilize creative workaround:

Code: Select all

$JobName2 = [Veeam.Backup.Core.CBackupJob]::Get("Tape Job Y");
$JobOptions2 = $Job2.GetOptions();
$JobOptions2.NotificationOptions.EmailNotificationAdditionalAddresses = "PS2@email.com";
$Job2.SetOptions($Joboptions2); 
Thanks.
veremin
Product Manager
Posts: 20407
Liked: 2299 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Set-VBRJobAdvancedNotificationOptions wont work for Tape

Post by veremin »

Eventually Get-VBRTapeJob cmdlet doesn't work for Veeam B&R standard edition
This should have been fixed in first patch. Have you updated already?
jb303uk
Novice
Posts: 7
Liked: never
Joined: Feb 11, 2015 11:27 am
Contact:

Re: Set-VBRJobAdvancedNotificationOptions wont work for Tape

Post by jb303uk »

v.Eremin wrote:Tapes jobs are editable via either Set-VBRFileToTapeJob or Set-VBRBackupToTapeJob. Currently, there is no way to change notification settings, using the said commandlets.

So, in order to achieve your goal, you can utilize creative workaround:

Code: Select all

$JobName2 = [Veeam.Backup.Core.CBackupJob]::Get("Tape Job Y");
$Job2 = Get-VBRTapeJob -Name $JobName2;
$JobOptions2 = $Job2.GetOptions();
$JobOptions2.NotificationOptions.EmailNotificationAdditionalAddresses = "PS2@email.com";
$Job2.SetOptions($Joboptions2); 
Thanks.

Hi,
I maybe going mad but I cant get that code to work, I get an error on line 2, saying 'A tape job with the specified name does not exist: Veeam.Backup.Core.CBackupJob....'
I have looked and looked at it and the name of the Job is right.

Anyway I managed to get past that by just running

Code: Select all

$Job2 = Get-VBRTapeJob;
with nothing on the end (I only have 1 tape job)
This gets past that error but it then gets stuck on line 3!

(Edited) code below:

Code: Select all

$JobName2 = [Veeam.Backup.Core.CBackupJob]::Get("Tape Job Y");
$Job2 = Get-VBRTapeJob;
$JobOptions2 = $Job2.GetOptions();

Method invocation failed because [Veeam.Backup.PowerShell.Infos.VBRBackupToTapeJob] does not contain a method named 'GetOptions'.
Can you check if you get this error?
I am on 8.0.0.917, Enterprise Edition

Thanks
James
veremin
Product Manager
Posts: 20407
Liked: 2299 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Set-VBRJobAdvancedNotificationOptions wont work for Tape

Post by veremin »

My bad, the second line in the provided code seems to be unnecessary. I've edited my post already. Try the following variant:

Code: Select all

$Job2 = [Veeam.Backup.Core.CBackupJob]::Get("Tape Job Y");
$JobOptions2 = $Job2.GetOptions();
$JobOptions2.NotificationOptions.EmailNotificationAdditionalAddresses = "PS2@email.com";
$Job2.SetOptions($Joboptions2); 
Thanks.
jb303uk
Novice
Posts: 7
Liked: never
Joined: Feb 11, 2015 11:27 am
Contact:

Re: Set-VBRJobAdvancedNotificationOptions wont work for Tape

Post by jb303uk »

v.Eremin wrote:My bad, the second line in the provided code seems to be unnecessary. I've edited my post already. Try the following variant:

Code: Select all

$Job2 = [Veeam.Backup.Core.CBackupJob]::Get("Tape Job Y");
$JobOptions2 = $Job2.GetOptions();
$JobOptions2.NotificationOptions.EmailNotificationAdditionalAddresses = "PS2@email.com";
$Job2.SetOptions($Joboptions2); 
Thanks.
Hi,
I can confirm that the script does not error out now and if i run just $JobOptions2.NotificationOptions it shows me the values that i have entered but it doesn't seem to save it! :cry:
Am I going mad? Does anyone else get that on v8.0.0.917?

PS if i use the Disk job name it works fine, it seems to just be tape jobs.

Cheers
James
veremin
Product Manager
Posts: 20407
Liked: 2299 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Set-VBRJobAdvancedNotificationOptions wont work for Tape

Post by veremin »

Nope, you aren't going mad whatsoever. It doesn't look that those settings are changeable via PS for tape jobs. I'll pass this information to the dev.team and see what can be done in this regard. Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests