Set-VBRJobAdvancedNotificationOptions wont work for Tape

PowerShell script exchange

Set-VBRJobAdvancedNotificationOptions wont work for Tape

Veeam Logoby jb303uk » Wed Mar 11, 2015 3:21 pm

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
jb303uk
Novice
 
Posts: 7
Liked: never
Joined: Wed Feb 11, 2015 11:27 am

Re: Set-VBRJobAdvancedNotificationOptions wont work for Tape

Veeam Logoby pavel37 » Sun Mar 15, 2015 6:44 pm

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).
pavel37
Lurker
 
Posts: 1
Liked: never
Joined: Mon Jan 12, 2015 3:01 pm
Full Name: Pavel Poklad

Re: Set-VBRJobAdvancedNotificationOptions wont work for Tape

Veeam Logoby v.Eremin » Mon Mar 16, 2015 9:56 am

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.
v.Eremin
Veeam Software
 
Posts: 13281
Liked: 970 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Set-VBRJobAdvancedNotificationOptions wont work for Tape

Veeam Logoby v.Eremin » Mon Mar 16, 2015 10:00 am

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?
v.Eremin
Veeam Software
 
Posts: 13281
Liked: 970 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Set-VBRJobAdvancedNotificationOptions wont work for Tape

Veeam Logoby jb303uk » Mon Mar 16, 2015 4:55 pm

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
jb303uk
Novice
 
Posts: 7
Liked: never
Joined: Wed Feb 11, 2015 11:27 am

Re: Set-VBRJobAdvancedNotificationOptions wont work for Tape

Veeam Logoby v.Eremin » Tue Mar 17, 2015 9:40 am

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.
v.Eremin
Veeam Software
 
Posts: 13281
Liked: 970 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Set-VBRJobAdvancedNotificationOptions wont work for Tape

Veeam Logoby jb303uk » Tue Mar 17, 2015 10:07 am

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
jb303uk
Novice
 
Posts: 7
Liked: never
Joined: Wed Feb 11, 2015 11:27 am

Re: Set-VBRJobAdvancedNotificationOptions wont work for Tape

Veeam Logoby v.Eremin » Tue Mar 17, 2015 11:24 am

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.
v.Eremin
Veeam Software
 
Posts: 13281
Liked: 970 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 5 guests