PowerShell script exchange
Post Reply
jcwuerfl
Enthusiast
Posts: 44
Liked: 4 times
Joined: Jun 29, 2011 8:26 pm
Full Name: James
Contact:

How do you set Notification Email Address?

Post by jcwuerfl » 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

tsightler
VP, Product Management
Posts: 5617
Liked: 2429 times
Joined: Jun 05, 2009 12:57 pm
Full Name: Tom Sightler
Contact:

Re: How do you set Notification Email Address?

Post by tsightler » 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)

jcwuerfl
Enthusiast
Posts: 44
Liked: 4 times
Joined: Jun 29, 2011 8:26 pm
Full Name: James
Contact:

Re: How do you set Notification Email Address?

Post by jcwuerfl » Apr 11, 2012 1:29 pm

Great thank you.

Andreas Neufert
Veeam Software
Posts: 4247
Liked: 779 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Re: How do you set Notification Email Address?

Post by Andreas Neufert » 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

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests