Looking for a event id that can tell me that the computer has started

Page 1 of 2 12 LastLast

  1. Posts : 60
    Windows 7 professional 64 bit
       #1

    Looking for a event id that can tell me that the computer has started


    Hello,

    Of all of the event ids that are generated when my PC starts, I am looking for one that I can use to trigger an e-mail to myself.

    For example, when my backup starts, event id 4097 has been setup to trigger an e-mail to me stating that my backup has started. Event id 4098 has been setup to trigger an e-mail notifying me that my backup has finished.

    In the past I had issues with my backups completing. Without going into the details, my backup issue appears to have been resolved. If I do not receive e-mails stating that my backup has started and
    ended, I know that there was some issue and I can research the problem.

    I sometimes leave my computer on overnight with some application open. In the past, my machine would sometimes restart.

    I use to have a problem with my computer crashing or freezing. After my graphic card went bad and had been replaced, I do not believe that my PC crashes as often.

    To early an event and I may not be able to send an e-mail.

    When I get the e-mail and I know that neither I nor any member of my family did not start the computer, I can look through the logs to see if I can determine why.

    Does anyone have a suggestion as to a good event id to trigger on?

    If I have select the wrong area to post this thread I apologize .

    Thanks in advance

    Stu
      My Computer


  2. Posts : 6,285
    Windows 10 Pro X64
       #2

    You could run a Powershell script from the Startup folder to do this: Something like:

    $smtp = new-object Net.Mail.SmtpClient("mail.example.com")

    if( $Env:SmtpUseCredentials -eq "true" ) {
    $credentials = new-object Net.NetworkCredential("username","password")
    $smtp.Credentials = $credentials
    }
    $objMailMessage = New-Object System.Net.Mail.MailMessage
    $objMailMessage.From = "script@mycompany.com"
    $objMailMessage.To.Add("you@yourcompany.com")
    $objMailMessage.Subject = "eMail subject Notification"
    $objMailMessage.Body = "Hello world!"

    I did a Google search to find the above: send email from batch file
      My Computer


  3. Posts : 4,161
    Windows 7 Pro-x64
       #3

    It's much simpler to just create a scheduled task at startup to send an email. "Start up" is one of the events you can specify as a trigger.
      My Computer


  4. Posts : 6,285
    Windows 10 Pro X64
       #4

    On Windows 8 Send an E-mail is deprecated. Have not tried it on Windows 7.

    Looking for a event id that can tell me that the computer has started-deprecatedfeature.jpg
      My Computer


  5. Posts : 60
    Windows 7 professional 64 bit
    Thread Starter
       #5

    Does the "start up" event have an event id?


    Hello carwiz,

    Does the "start up" event have an event id? Can one scan for "start up" in the logs?

    Thanks

    Stu
      My Computer


  6. Posts : 4,161
    Windows 7 Pro-x64
       #6

    I don't know of a specific event for start up. I checked through mine and couldn't identify anything tied to that event alone. Did you try the Task Schedule? You do need a SMTP server address to send it. Your mail server probably has one. The address will be something like "smtp." followed by your normal server address. This bypasses normal email processes. Probably why W8 won't use it.
      My Computer


  7. Posts : 4,161
    Windows 7 Pro-x64
       #7

    Ztruker said:
    On Windows 8 Send an E-mail is deprecated. Have not tried it on Windows 7.

    Looking for a event id that can tell me that the computer has started-deprecatedfeature.jpg
    I found this at Windows Development Center for task scheduler interface:

    Windows 8 and Windows Server 2012: This interface has been removed. Please use IExecAction with the powershell Send-MailMessage cmdlet as a workaround.
      My Computer


  8. Posts : 4,566
    Windows 10 Pro
       #8

    You could use the event viewer application under user profile service started id 1531. I think that would be sufficient. Of course for this the auto login feature must be used. Windows not having a password for only a single account so it auto logins.

    Another thing that could work is if you use the action center, the security center service seems to only start when the pc boots, (unless it was manually disabled,stopped) that is event ID 1
      My Computer


  9. Posts : 4,161
    Windows 7 Pro-x64
       #9

    I tried the task method and couldn't get it to send. I kept getting the error below. Apparently, so does everyone else that attempts it.

    CDO_E_SMTP_SEND_FAILED
    0x80040211L
    The message could not be sent to the SMTP server. The transport error code was %2. The server response was %1


    Andrew - Scripted Diagnostics also get Event ID 1.
      My Computer


  10. Posts : 6,285
    Windows 10 Pro X64
       #10

    carwiz said:
    Ztruker said:
    On Windows 8 Send an E-mail is deprecated. Have not tried it on Windows 7.

    Looking for a event id that can tell me that the computer has started-deprecatedfeature.jpg
    I found this at Windows Development Center for task scheduler interface:

    Windows 8 and Windows Server 2012: This interface has been removed. Please use IExecAction with the powershell Send-MailMessage cmdlet as a workaround.
    That's the Powershell script I posted above I think.
      My Computer


 
Page 1 of 2 12 LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 02:30.
Find Us