Solved

Windows 2012 Task Scheduler

Posted on 2014-03-17
7
493 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

Table of Contents: Lesson 1 - Installing Windows Server 2012 (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Server/Windows_Server_2012/A_11592-Become-an-Administrator-Installing-Windows-Server-2012.html) Lesson 2 - Configuring Ser…
Table of Contents: Lesson 1 - Installing Windows Server 2012 (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Server/Windows_Server_2012/A_11592-Become-an-Administrator-Installing-Windows-Server-2012.html) Lesson 2 - Configuring Ser…
In this Micro Tutorial viewers will learn how to restore their server from Bare Metal Backup image created with Windows Server Backup feature. As an example Windows 2012R2 is used.
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 …

821 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