Email Notifications after Task

PowerShell script exchange

Email Notifications after Task

Veeam Logoby neil.hsieh » Thu Sep 17, 2015 8:39 pm

Hi All,

I have an automated Powershell script just about done that will allow us to switch between 2 NAS drives on the Veeam server (one enable, other disable, and vice versa) on a quarterly basis.

Now I am stuck at the point where we would like email notifications whenever this switch happens so we can know which drives successfully Enabled and/or Disabled.
I am looking for a Powershell script so I can just append that to the script I have now.

I have tried the following but to no success: http://helpcenter.veeam.com/backup/80/powershell/set-vbrjobadvancednotificationoptions.html

Any help would be greatly appreciated.

Thanks.
neil.hsieh
Novice
 
Posts: 4
Liked: never
Joined: Wed Sep 16, 2015 2:19 pm
Full Name: Neil

Re: Email Notifications after Task

Veeam Logoby v.Eremin » Fri Sep 18, 2015 10:01 am

You should probably stick to ordinary Windows PowerShell, not VB&R snap-in. Are those drives added under different letters or maybe have some distinguishing factor that can be seen via Windows PowerShell?
v.Eremin
Veeam Software
 
Posts: 13281
Liked: 970 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Email Notifications after Task

Veeam Logoby neil.hsieh » Fri Sep 18, 2015 1:49 pm

The drives exist under different servers and we just import them through Veeam. How would this procedure wok with Windows PowerShell?
neil.hsieh
Novice
 
Posts: 4
Liked: never
Joined: Wed Sep 16, 2015 2:19 pm
Full Name: Neil

Re: Email Notifications after Task

Veeam Logoby v.Eremin » Fri Sep 18, 2015 2:33 pm

Can you elaborate on "import through Veeam" portion? Are they added as different repositories to a backup console? Thanks.
v.Eremin
Veeam Software
 
Posts: 13281
Liked: 970 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Email Notifications after Task

Veeam Logoby neil.hsieh » Fri Sep 18, 2015 3:44 pm

It is added through Backup Infrastructure -> Mangaed Servers and is added as a Windows Server. I believe after adding through here, its is automatically updated in the Backup Repositories.
neil.hsieh
Novice
 
Posts: 4
Liked: never
Joined: Wed Sep 16, 2015 2:19 pm
Full Name: Neil

Re: Email Notifications after Task

Veeam Logoby v.Eremin » Mon Sep 21, 2015 10:34 am

Servers added to managed servers don't automatically get assigned repository role. So, your deployment and your overall goal are still unclear to me. Thanks.
v.Eremin
Veeam Software
 
Posts: 13281
Liked: 970 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Email Notifications after Task

Veeam Logoby neil.hsieh » Mon Sep 21, 2015 2:01 pm

Sorry if I've not been too clear on answering the questions you have for me because I am still getting acquainted with Veeam as I've only been assigned to work on this recently.

As far as I know, I've only had to add in 1 server, and that was through Backup Infrastructure -> Managed Servers -> Microsoft Windows -> (right click) Add Server, and I am adding in our NAS drives with its DNS name which exist in our domain which in which our Veeam server exists in as well.

Going back to your comment about using Powershell and not the Veeam Snap-ins, is there a pre defined function in Powershell to send email notifications after a certain task is completed? If so can you show me how this is done?

Thanks.
neil.hsieh
Novice
 
Posts: 4
Liked: never
Joined: Wed Sep 16, 2015 2:19 pm
Full Name: Neil

Re: Email Notifications after Task

Veeam Logoby weiyentan » Wed Sep 23, 2015 5:10 am

Good example on how to write the email notification in standard Microsoft Powershell is here:

http://www.adminarsenal.com/admin-arsen ... il-example

and here:

http://blogs.msdn.com/b/rkramesh/archiv ... cript.aspx
weiyentan
Lurker
 
Posts: 1
Liked: never
Joined: Sat May 24, 2014 8:47 am
Full Name: Wei-Yen Tan

Re: Email Notifications after Task

Veeam Logoby Dima P. » Wed Sep 23, 2015 4:28 pm

Hi folks,

Some Veeam Endpoint Backup users has already written a really great examples. Feel free to adjust and test some proposed scripts from this thread
Dima P.
Veeam Software
 
Posts: 6249
Liked: 440 times
Joined: Mon Feb 04, 2013 2:07 pm
Location: SPb
Full Name: Dmitry Popov

Re: Email Notifications after Task

Veeam Logoby v.Eremin » Mon Sep 28, 2015 3:38 pm

Is there a pre defined function in Powershell to send email notifications after a certain task is completed?

Sure you can send an email after a certain task. In order to do that either use Send-MailMessage if you're on PowerShell 4.0 or higher or leverage New-Object Net.Mail.SmtpClient() if you're on older versions.

However, it's still not what a certain task. Is that drive rotation on the said NAS device or something different?

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 2 guests