Server 2012 - Send Email on Reboot

Hello all,
In Windows Server 2012, the 'send an email' action in task scheduler has been deprecated. For our 2008 and 2008 R2 servers, we used this feature to send an email to the IT department whenever Event ID 1074 appeared. Now, we do have VMWare (for virtual servers)
and our monitoring agent send emails to report when the machines go offline, but they don't always get caught and it's just nice to have the safeguard.
We have set up a script with the trigger being Event ID 1074. The script works if you launch the ps1 file manually or start the task manually, however, when you reboot the server the email does not get sent. The task scheduler shows the 'Last Run Result'
as being 'A system shutdown is in progress. (0x8007045B).
We are using a designated user with admin and 'logon as batch file' privileges and like I said, manually executing the script sends the email we are looking for.
The same script can be used with the trigger 'At System Startup' and it is successful, but we would prefer to do it when the system is going down rather than coming up.
Here is our script:
<# UPDATE variables for str SERVER AND LOCATION #>
$strServer = "OurServer"
$strLocation = "OurLocation"
$mailServer = "mail.server.com"
$mailSubject = “Reboot- $strServer”
$mailmessage = “The server, $strServer located in $strLocation has been rebooted. Based on System EventID 1074"
Send-MailMessage -To “OurEmail <[email protected]>" -From “$strServer <$[email protected]>" -SMTPServer $mailServer -Subject $mailSubject -Body $mailmessage
Any assistance/tips would be greatly appreciated.

Hi KSllT,
In addition to the suggestion of tim .
Please check whether "system" account has access permission of the script folder .
Also you can try to set "run windows powershell scripts first" in shutdown properties :
Best Regards
Elton JI
We
are trying to better understand customer views on social support experience, so your participation in this
interview project would be greatly appreciated if you have time.
Thanks for helping make community forums a great place.

Similar Messages

  • Settings on Microsoft Exchange Server  for sending Email from BW to emailid

    Hello Everybody,
    I wanted to know that for sending Email from SAP System (that is via Information broadcasting feature of BW )to Email IDS of individuals do we need to make any configurations on Exchange Server as well or some RFC between Microsoft Exchange Server and BW .I have made all settings for SMTP through SCOT transaction but still not able to send mails.From our Exchange Server,the connector is removed ,do we need to reconnect it for this purpose.kindly please tell me wt all configurations do i need to make on Mail server for sending Emails as iam not able to do the same now.If somebody can send a PDF/Word document in support for the same on my email Id [email protected] ,i shall be highly obliged.Your help shall be appreciated ,kindly revert at earliest.
    Regards,
    saumya

    Hi Somya,
    Looks like you are deep into Information Broadcasting. I am sure you must have seen this, still sharing with you -
    SAP Notes -
    875136 - Node ID is missing in the status message for RFC connection
    455140 - Configuration E-mail, fax, paging/SMS via SMTP 
    regards
    Vikash

  • Can SQL Server Express Send Emails?

    I am fiddling around with one of my SQL Server Express instances, and I'm trying to get it to send me an email.  I just read these links.
    http://execsql.org/configure-send-database-email-sql-server-2012-express-edition
    http://www.databasejournal.com/features/mssql/article.php/3626056/Database-Mail-in-SQL-Server-2005.htm
    I followed all the steps there, and now, as I'm trying to send myself an email, I get this message.
    The mail could not be sent to the recipients because of the mail server failure. Exception Message: Could not connect to mail server.
    When I run this:
    SELECT * FROM msdb.dbo.sysmail_event_log;
    I see this:
    description
    The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2015-01-21T14:25:36). Exception Message: Could not connect to mail server. (The requested name is valid, but no data of the requested type was found).
    Any idea what's wrong?  Can SQL Server Express even send emails???
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

    Hello,
    You can make use of CLR Integration for sending email from SQL Server Express.
    http://www.sqlservercentral.com/articles/SQL+Server+Express/71341/
    http://www.vnypatel.com/sending-emails-with-clr-sql-server-express-editions
    SQL Server Express does not support database mail.
    https://msdn.microsoft.com/en-us/library/cc645993.aspx
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • Send email on reboot, shutdown and boot

    Hi, I'm trying to setup my 10.4.11 machine (I have one that runs leopard and one that runs tiger) so that it sends a email on reboot, shutdown and boot. I have attempted to do so by placing a script that sends a email via the terminal mail command in /etc/rc.local for boot, /etc/rc.shutdown.local for shutdown and /etc/rc.reboot.local for reboot. The only problem is that when I reboot the shutdown script is executed instead of the reboot script and rc.local is never executed. My guess is that I need to use a launchd task for the boot email instead of rc.local but I'm not sure what Apple is using instead of rc.reboot.local ...any ideas? Thanks!

    I have solved this problem by assuming that reboot and shutdown both rely on rc.shutdown.local as appears to be the case and thusly changing the title of the email to say that the server is shutting down -or- rebooting (which should become obvious as in the case of it rebooting a booting up email will follow shortly). I then copied rc.local to another location, ensured it had the executable bit set, and used Lingon to execute it on boot since rc.local does not seem to be working. Emails upon sleep and wake (machine set to sleep after one minute when switched to battery and acwake has been set to 1 via pmset so that when power resumes the machine automatically wakes up effectively turning the laptop battery into a UPS) are taken care of via sleepwatcher.

  • Messaging Server cannot send email to gmail but can send email to yahoo

    I'm using Messaging server 7.0. My company's domain is {color:#ff0000}*sun-vietnam.com*{color} and the email server name is {color:#ff0000}*mail.sun-vietnam.com*{color}, this name is {color:#ff0000}*registered and resolved*{color} correctly in the DNS server of the ISP.
    When using an email account form this domain, I can send email to an email address from {color:#ff0000}*yahoo.com*{color} such as {color:#ff0000}****@yahoo.com*{color} and the {color:#ff0000}****@yahoo.com*{color} account can receives this email immediately.
    But when I try to send an email address to an email address from {color:#ff0000}*gmail.com*{color} such as {color:#ff0000}****@gmail.com*{color}, the email succesfully sent without no error notified, however the {color:#ff0000}****@gmail.com*{color} account cannot receives this email although I waited for serveral days.
    If anyone know the solution to fix this problem, please help me, thanks all of you very much.
    Edited by: chuotbeo on Feb 15, 2009 7:26 PM

    Hi Shane.
    I'm so sorry, the administrator in my company didn't provide enough information for me.
    Actually, when I sent email to ***@gmail.com, there was a notification sent to me by the system. The error notification is :
    "*{color:#ff0000}Subject: Delivery Notification: Delivery has been delayed Return-path: <[email protected]> {color}*
    Received: from tcp-daemon.mail.sun-vietnam.com by mail.sun-vietnam.com
    (Sun Java(tm) System Messaging Server 7.0-0.04 64bit (built Jun 20 2008))
    id <[email protected]>;
    Sat, 14 Feb 2009 00:30:02 +0700 (ICT)
    Received: from Mali ([118.71.41.126]) by mail.sun-vietnam.com
    (Sun Java(tm) System Messaging Server 7.0-0.04 64bit (built Jun 20 2008)) with ESMTPA
    id <[email protected]> for [email protected]; Wed, 11 Feb 2009 14:21:39 +0700 (ICT) "
    Have you ever seen this error notification, please help me. Thank you anyway :)
    Best regards,

  • Any SMTP server to send emails from Localhost ??

    Hi,
    i want to email user,
    is there any FREE SMTP server available to download to use it in localhost PC, that i can use to configure it and send my email to the user at perticular email ID from My LOCALHOST PC ?
    i need authentication to send emails..
    so i need my own java SMTP server for localhost to send EMAIL
    my Email Application is ready and running.
    but i need SMTP server
    Please give me solutions.....

    http://java.sun.com/products/javamail/FAQ.html#servers
    And of course http://sendmail.org/

  • Email server not sending emails

    Since the last Apple upgrade, I cannot get any email responses out that I attempt to send to others if I use the provided mail app.  An error message comes up, informing me that the server has rejected the message, and it will be placed in the draft box until it can be sent. Any suggestions? I have both AOL and gmail accounts, and am phasing out AOL and plan to use gmail exclusively.
    I can complete messages if I go online and sign in to my gmail and AOL accounts.
    Thanks for any suggestions!! It's driving me nuts.

    Generally the solution to this kind of a problem is to delete the account in Mail entirely, including the SMTP server listing then setting up the account again from scratch. More recent versions of Mail are pretty intelligent about choosing the settings for either AOL or GMail.

  • Mail server working sending emails between user accounts but not to other (outside) email accounts?

    Hi!
    I am new to Mac OS X Server Mail and I am trying to set up.  I have successfully started the mail services and created 2 user accounts.  Those accounts can email each other back and forth, no problem; however, they cannot send/receive to other email addresses.  Anyone know why this would happen?
    I'm learning OS X Server and appreciate any help!

    Hi,
    setting up mail can is quite complicated.
    Suggest you watch this video:
    http://www.youtube.com/watch?v=FAODxn7LF6k&list=PL01BB6048468891F7&feature=share &index=16
    this should give you some ideas where to look.
    Have in mind that you need to do DNS set-ups, need to have a static IP address ( or use a DynDNS service ),very likely also add MX records etc. etc.

  • SQL Server 2012 Database Email is not working with AWS SES Services

    Hi Greetings to all,
    I have issue with the SQL Server Database mail Services. I have Configured Amazon Simple Email Services (AWS SES) as db profile in SQL Server and for last 2 years its working perfectly. But, from last two days on wards it is not working properly the Emails
    are queued but not sent to the recipients. the SES Services are working fine in outlook. but, not working in SQL Server. 
    Please help on this. tried changing the ports no result only one or two emails only sent remaining are failing.the info messages is as below
    Message
    The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 10 (2015-04-10T17:12:41). Exception Message: Cannot send mails to mail server. (The operation has timed out.).
    RehaanKhan. M

    Hello,
    Try to use port 465, port 2587 or port 587 instead of using port 25, as explained on the following articles.
    http://docs.aws.amazon.com/ses/latest/DeveloperGuide/smtp-issues.html
    http://docs.aws.amazon.com/ses/latest/DeveloperGuide/smtp-connect.html
    The first of above URLs is intended for troubleshooting SMTP issues in general.
    Verify you the mail account has not reached any limit. Limit of emails per day, per second, etc.
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • SQL server agent send email

    I set up email notification for a job completes. I configured database mail profile and mail account. This works fine and I can send out test email.
    However, the SQL agent couldn't send out email and when I tried to restart the SQL server agent, I got the following errors:
    Message
    [260] Unable to start mail session (reason: Microsoft.SqlServer.Management.SqlIMail.Server.Common.BaseException: Mail configuration information could not be read from the database. ---> System.InvalidCastException: Unable to cast object of type 'System.DBNull'
    to type 'System.Byte[]'.
       at Microsoft.SqlServer.Management.SqlIMail.Server.DataAccess.DataAccessAdapter.GetAccount(Int32 accountID)
       --- End of inner exception stack trace ---
       at Microsoft.SqlServer.Management.SqlIMail.Server.DataAccess.DataAccessAdapter.GetAccount(Int32 accountID)
    My SQL server is SQL 2008 with service pack 3.
    Anybody has any idea what's the problem is?
    Thanks

    Hi Ying,
    You could try below suggestions.And restart SQL Server Agent.
    Please refer:
    http://www.developerjoint.com/kb/9363-trouble-with-sql-2005-database-mail.aspx.
    Thanks,
    Maggie
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. This can be beneficial to other community members reading the thread.

  • Ssrs 2012 - send email failure

    Hi,
    I have scheduled a report but this is the error it shows:
    Failure sending mail: Failure sending mail.
    Do you know where I can get detailed information on the error?
    Any suggestions please?

    Did you setup mail profile properly?
    see the subscription config to get more details on error first
    http://www.sqldbpros.com/2013/11/ssrs-subscription-error-failure-sending-mail-the-report-server-has-encountered-a-configuration-error-mail-will-not-be-resent/
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs
    Hi,
    I have read your links.... thank you, and believe what I have done is correct.
    But may be if I get more detailed information about this error that I get from a log file or somewhere then I can investigate the error further.
    I should mentioned that the sql query in the link you sent does not return any rows and I do not know where to see the subscription Configuration?
    Is there a way to see more information about the error message I get?
    Thank you
    Yep..The first place where you can check is the subscriptions page in report server
    Also see this similar discusiion
    http://social.technet.microsoft.com/Forums/en-US/e18054ca-82ee-4281-8217-078013e1109f/ssrs-error-failure-sending-mail-the-report-server-has-encountered-a-configuration-error-mail-will?forum=sqlreportingservices
    And this link
    http://sirsql.net/blog/2012/4/19/ssrsemail-subscriptions-not-being-delivered.html
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Cut off from server cant send emails please help

    using thunderbird I cannot se.d emails .I keep getting asked for a new password ,to no avail .Iam told Iam cut
    off from the server.How to retrieve the situation is the question

    To diagnose problems with Thunderbird, try one of the following:
    *Restart Thunderbird with add-ons disabled (Thunderbird Safe Mode). On the Help menu, click on "Restart with Add-ons Disabled". If Thunderbird works like normal, there is an Add-on or Theme interfering with normal operations. You will need to re-enable add-ons one at a time until you locate the offender.
    *Restart the operating system in '''[http://en.wikipedia.org/wiki/Safe_mode safe mode with Networking]'''. This loads only the very basics needed to start your computer while enabling an Internet connection. Click on your operating system for instructions on how to start in safe mode: [http://windows.microsoft.com/en-us/windows-8/windows-startup-settings-including-safe-mode Windows 8], [http://windows.microsoft.com/en-us/windows/start-computer-safe-mode#start-computer-safe-mode=windows-7 Windows 7], [http://windows.microsoft.com/en-us/windows/start-computer-safe-mode#start-computer-safe-mode=windows-vista Windows Vista], [http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/boot_failsafe.mspx?mfr=true" Windows XP], [http://support.apple.com/kb/ht1564 OSX]
    ; If safe mode for the operating system fixes the issue, there's other software in your computer that's causing problems. Possibilities include but not limited to: AV scanning, virus/malware, background downloads such as program updates.

  • Can my wife andI use the same smpt server to send emails

    I am trying to set up email accounts for both me and my wife on the same imac running mountain lion.
    My account was ok, but when I try to set up hers the SMPT server says ( offline ). Although the incoming ( POP ) server is the same. Cannot the outgoing ( SMTP ) server be the same ?

    I would suggest you try the following.  On my iMac it solved the same problem.  Set up both yours and her Mail Accounts with the correct SMTP Server, whatever it is, in the provided line and THEN Select the nearby Box "Use Only This Server":
    Hope this helps
    Message was edited by: Radiation Mac

  • TS3899 Cannot connect to server. Can send emails but unble to receive any on iCloud account .

    Keep getting message 'cannot connect to server' can send emails on iCloud but not receive them.
    Help please.
    Belgar2

    iOS: Unable to send or receive email
    http://support.apple.com/kb/TS3899
    Can’t Send Emails on iPad – Troubleshooting Steps
    http://ipadhelp.com/ipad-help/ipad-cant-send-emails-troubleshooting-steps/
    Setting up and troubleshooting Mail
    http://www.apple.com/support/ipad/assistant/mail/
    Why Does My iPad Say "Cannot Connect to Server"?
    http://www.ehow.co.uk/info_8693415_ipad-say-cannot-connect-server.html
    iPad Mail
    http://www.apple.com/support/ipad/mail/
    Try this first - Reset the iPad by holding down on the Sleep and Home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. (This is equivalent to rebooting your computer.)
    Or this - Delete the account in Mail and then set it up again. Settings->Mail, Contacts, Calendars -> Accounts   Tap on the Account, then on the red button that says Remove Account.
     Cheers, Tom

  • I keep getting the message can,t connect to server, can't get email, can't send email from outlook account on ipad

    I keep getting message cannot connect to server, cannot send email, cannot get email from my outlook account . This has been happening for past 3 days Feb 2014

    Check your internet connection...
    If you are connected but can't access anything, your WiFi must be slow.

Maybe you are looking for

  • API for Physical Inventory Tag Count

    Hi , Please let me know if any Public API available for updating the physical Inventory tag count ? We have requirement like update of physical counts of Inventory tags, the idea is the counts  are stored  in flat file is in same column format of Phy

  • Nokia X3 -00 Message Bugs

    After pressing the send on the message editor, nothing happens, my text message wont send and icant exit the message editor itself, i tried pressing the "end call button" to close the message editor, also by the exit editor option but neither of them

  • Problem with HQL (Hibernate) Query using Netbeans 6.7.1

    Hi. I have a database which possesses only one table. This table is called "Login" and has two columns: "username" and "password". I have inserted two rows in it, so it is not empty. Using HQL within Netbeans, I write the following query FROM LoginTh

  • Writing to DV tape

    Once I've plugged my camera in how do I write to DV tape? i. What setting do I put my camera on? ii. What settings do I used in export? Cheers Ben

  • Two files - 'merge'

    I caused myself a problem a couple of years ago when a disc failed and in relation to iPhoto I did a sloppy job of restoring everything from backups. It is so long ago that I cannot remember what, how and why I did it but basically I restored all the