Solved

Windows 2012 Task Scheduler

Posted on 2014-03-17
7
502 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 

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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

The following article is comprised of the pearls we have garnered deploying virtualization solutions since Virtual Server 2005 and subsequent 2008 RTM+ Hyper-V in standalone and clustered environments.
The article will show you how you can maintain a simple logfile of all Startup and Shutdown events on Windows servers and desktops with PowerShell. The script can be easily adapted into doing more like gracefully silencing/updating your monitoring s…
In this Micro Tutorial viewers will learn how to use Windows Server Backup to create full image of their system. Tutorial shows how to install Windows Server Backup Feature on Windows 2012R2 and how to configure scheduled Bare Metal Recovery backup.…
In this Micro Tutorial viewers will learn how they can get their files copied out from their unbootable system without need to use recovery services. As an example non-bootable Windows 2012R2 installation is used which has boot problems.

729 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