PowerShell script exchange
-
jcwuerfl
- Enthusiast
- Posts: 44
- Liked: 4 times
- Joined: Jun 29, 2011 8:26 pm
- Full Name: James
-
Contact:
Post
by jcwuerfl »
this post
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: 6035
- Liked: 2860 times
- Joined: Jun 05, 2009 12:57 pm
- Full Name: Tom Sightler
-
Contact:
Post
by tsightler »
this post
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:
Post
by jcwuerfl »
this post
Great thank you.
-
Andreas Neufert
- VP, Product Management
- Posts: 7081
- Liked: 1511 times
- Joined: May 04, 2011 8:36 am
- Full Name: Andreas Neufert
- Location: Germany
-
Contact:
Post
by Andreas Neufert »
this post
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
Users browsing this forum: No registered users and 2 guests