Remove singel email from notification

PowerShell script exchange

Remove singel email from notification

Veeam Logoby Stapper » Wed May 06, 2015 4:18 pm

I'm having a hard time finding the correct way to remove an email from the "notification" field via powershell.
I have to remove 1 of several email notifications from all jobs. Can this be done using powershell or do I need to remove them manully?
Do I just need to rewrite all the email adresses I do want or can I just say remove that one?

Will following code work or not? I don't have a testing environement so i need to know, if this will only affect the email notification job setting or also other settings?
Code: Select all
$jobs = Get-VBRJob
foreach ($job in $jobs)
{
$JobOptions = $Job.GetOptions()
$JobOptions.NotificationOptions.EmailNotification = $true
$JobOptions.NotificationOptions.EmailNotificationAddresses = "admin@backup.com"
$Job.SetOptions($Joboptions)
}


Can this be set to remove emailnotification addresses or is there no such thing?
Code: Select all
$JobOptions.NotificationOptions.EmailNotificationAddresses = "admin@backup.com"
Stapper
Lurker
 
Posts: 1
Liked: never
Joined: Wed May 06, 2015 4:04 pm
Full Name: Verstappen

Re: Remove singel email from notification

Veeam Logoby v.Eremin » Thu May 07, 2015 4:22 pm

Just to be sure there are several addresses specified in job notification settings as recipients, and you're willing to remove just one of those? Can you provide the current output of $JobOptions.NotificationOptions or $JobOptions.NotificationOptions.EmailNotificationAddresses? The actual addresses can be replaced of course.

Thanks.
v.Eremin
Veeam Software
 
Posts: 13293
Liked: 973 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 11 guests