Solved

Windows 2012 Task Scheduler

Posted on 2014-03-17
7
491 Views
Last Modified: 2014-04-20
Hi.  Windows 2012 no longer supports sending of an email in Task Scheduler therefore, I need to find a way to have an email generated when the server is rebooted.  Is this possible in Powershell and then call a powershell script on reboot?  Or perhaps a tool such as blat and  call blat?  Thx.
0
Comment
Question by:rrsmithab
  • 4
  • 2
7 Comments
 
LVL 10

Expert Comment

by:Scott Thomson
ID: 39935896
Can i possibly ask you a question. What is the reason you would like a server to notify you of a reboot? do you not have software such as solarwinds or SCOM systems?
0
 
LVL 23

Expert Comment

by:Mysidia
ID: 39935923
Personally;  I would suggest you  have monitoring software, such as  PRTG, Spiceworks, Nagios, ManageEngine Opmanager,  Solarwinds,  WhatsUp, or SCOM, on  another server to detect the reboot.      What happens when the server begins to reboot,  but  does not come back online  --- accidental shutdown,  or hang while shutting down, instead of successful reboot?   Then  you won't get an e-mail, that's what.....

I believe you can move this  e-mail thing over to 2012 by creating a VBScript;  .VBS file in notepad, and  schedule the VBScript,  though.

http://forums.asp.net/t/1618178.aspx?How+to+create+and+emails+Script+in+VBScript+

Imports System.Net.Mail
Imports System.Net

Dim Dest As New System.Net.Mail.MailAddress("recipient@example.com")
Dim msg As New System.Net.Mail.MailMessage
Dim smtp As New System.Net.Mail.SmtpClient

smtp.Host = "mymailserver.example.com"

msg.body = "Your message here"
msg.From = New Net.Mail.MailAddress("sender@example.com")
msg.Priority = Net.Mail.MailPriority.High
msg.Subject = "Hello, there!"

msg.IsBodyHtml = False
msg.To.Clear()
msg.To.Add(Dest)

smtp.send(msg)
0
 

Author Comment

by:rrsmithab
ID: 39975634
Thanks for trying to save me some work but there is an issue with the code and it failed.  The reason we want to do this is a safety net or plan B in case notifications don't go out.  We had a server reboot but neither vmware nor Opsview caught the reboot.  But it's in the logs of the server.
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

Accepted Solution

by:
rrsmithab earned 0 total points
ID: 39986469
Solution is that Powershell has a sendmail cmdlet that works in Task scheduler.  Thanks to everyone for their assistance.
0
 
LVL 10

Expert Comment

by:Scott Thomson
ID: 39986573
No worries, glad you managed a solution
0
 

Author Comment

by:rrsmithab
ID: 39992064
Thanks.
0
 

Author Closing Comment

by:rrsmithab
ID: 40011150
Found solution on my own.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The reason that corporations and businesses use Windows servers is because it supports custom modifications to adapt to the business and what it needs. Most individual users won’t need such powerful options. Here I’ll explain how you can enable Wind…
Resolve DNS query failed errors for Exchange
This tutorial will walk an individual through the process of configuring basic necessities in order to use the 2010 version of Data Protection Manager. These include storage, agents, and protection jobs. Launch Data Protection Manager from the deskt…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now