How do you set Notification Email Address?

PowerShell script exchange

How do you set Notification Email Address?

Veeam Logoby jcwuerfl » Tue Apr 10, 2012 9:38 pm

Assuming you need to use: Set-VBRJobOptions

If I do this I can see there is no Email Address set:

Code: Select all
$job=get-vbrjob -name theVMName
$jobOptions = Get-VBRJobOptions $job
$jobOptions.NotificationOptions
$jobOptions.NotificationOptions.EmailNotificationAddresses


So now how would you set it?


Also, how would you set the Retention Policy on # of Restore Points to Keep on disk?


Thanks
jcwuerfl
Enthusiast
 
Posts: 44
Liked: 3 times
Joined: Wed Jun 29, 2011 8:26 pm
Full Name: James

Re: How do you set Notification Email Address?

Veeam Logoby tsightler » Wed Apr 11, 2012 1:32 am

I would do something like:

Code: Select all
$Job = Get-VBRJob -Name $JobName
$JobOptions = $Job.GetOptions()
$JobOptions.NotificationOptions.EmailNotification = $true
$JobOptions.NotificationOptions.EmailNotificationAddresses = "admin@backup.com"
$Job.SetOptions($Joboptions)
tsightler
Veeam Software
 
Posts: 4768
Liked: 1737 times
Joined: Fri Jun 05, 2009 12:57 pm
Full Name: Tom Sightler

Re: How do you set Notification Email Address?

Veeam Logoby jcwuerfl » Wed Apr 11, 2012 1:29 pm

Great thank you.
jcwuerfl
Enthusiast
 
Posts: 44
Liked: 3 times
Joined: Wed Jun 29, 2011 8:26 pm
Full Name: James

Re: How do you set Notification Email Address?

Veeam Logoby Andreas Neufert » Wed Feb 25, 2015 5:15 pm

Hi everybody...
just a v8 update:

Code: Select all
Add-PSSnapin -Name VeeamPSSnapIn -ErrorAction SilentlyContinue
$Job = Get-VBRJob -Name $JobName
$JobOptions = $Job.GetOptions()
$JobOptions.NotificationOptions.SnmpNotification  = $true #Default: $false
$JobOptions.NotificationOptions.SendEmailNotification2AdditionalAddresses  = $true #Default: $false
$JobOptions.NotificationOptions.EmailNotificationAdditionalAddresses = "test1@test.local;test2@test.local" #Default: ""
$JobOptions.NotificationOptions.UseCustomEmailNotificationOptions = $true #Default: $false
$JobOptions.NotificationOptions.EmailNotificationSubject = "[%JobResult%] %JobName% (%VmCount% VMs) %Issues%" #Default: "[%JobResult%] %JobName% (%VmCount% VMs) %Issues%"
$JobOptions.NotificationOptions.EmailNotifyOnSuccess = $false #Default: $true
$JobOptions.NotificationOptions.EmailNotifyOnWarning = $true #Default: $true
$JobOptions.NotificationOptions.EmailNotifyOnError = $true #Default: $true
$JobOptions.NotificationOptions.EmailNotifyOnLastRetryOnly  = $true #Default: $true
$JobOptions.ViSourceOptions.VmAttributeName = "TestField1"   #Default: "Notes"
$JobOptions.ViSourceOptions.SetResultsToVmNotes = $true #Default: $false
$JobOptions.ViSourceOptions.VmNotesAppend = $false #Default: $true
$Job.SetOptions($Joboptions)
$JobOptions.NotificationOptions
$JobOptions.ViSourceOptions
Andreas Neufert
Veeam Software
 
Posts: 2198
Liked: 358 times
Joined: Wed May 04, 2011 8:36 am
Location: Germany
Full Name: @AndyandtheVMs Veeam PM


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 6 guests