Get Email Alerts for Computer Login - How To Guide

Remote Login Notifications with Windows
Concerned about unauthorized access to your computer, especially a server? Windows offers a method to receive email alerts each time a user logs in, provided the system has an internet connection. This provides an added layer of security and awareness.
The functionality will be implemented utilizing the Windows Task Scheduler. This tool is capable of triggering email notifications based on specific system events.
Leveraging Task Scheduler for Email Alerts
While the Task Scheduler includes an inherent email function, it lacks the customization needed for optimal use. Therefore, an alternative approach will be employed to achieve the desired level of control.
This method ensures you are promptly informed of any login activity on your system, enhancing your ability to monitor and protect sensitive data.
Setting Up the Notification System
The following steps will detail how to configure the Task Scheduler to send email notifications upon user login events. This process will involve utilizing external tools to overcome the limitations of the built-in email feature.
By implementing this system, you can maintain a vigilant watch over your computer’s access logs and respond swiftly to any potentially suspicious activity.
SendEmail and Task Scheduler Email Capabilities Compared
Windows Task Scheduler offers a built-in function to dispatch emails. However, its functionality is often limited for many users. Specifically, if your SMTP server necessitates authentication, the credentials used must align with those of the current Windows user account.
This native email feature can be adequate for those operating SMTP servers locally. But it frequently fails when attempting to utilize external email providers like Gmail or other third-party services.
Leveraging SendEmail for Reliable Command-Line Email
A more robust solution is to utilize SendEmail, a complimentary tool designed for sending emails directly from the command line. This allows for the creation of a single, concise command to initiate email delivery.
SendEmail distinguishes itself through its support for authentication protocols. This capability enables seamless email transmission via Gmail’s SMTP server, or any other server requiring user verification.
- Authentication Support: Crucially, SendEmail handles SMTP authentication, overcoming the limitations of the Task Scheduler’s built-in feature.
- Command-Line Interface: Its command-line nature makes it ideal for scripting and automation within Task Scheduler.
- Versatility: Compatible with a wide range of SMTP servers, including popular services like Gmail.
By employing SendEmail, users can reliably send emails from scheduled tasks, even when utilizing authenticated SMTP servers. This provides a dependable alternative to the often-problematic native email functionality within Task Scheduler.
Setting Up Login Notifications
To begin, access the Task Scheduler application. This is done by typing "Task Scheduler" into the Start menu search bar and then selecting it with the Enter key.

Within the Task Scheduler interface, select the option to "Create Task" from the sidebar menu.

On the "General" tab, assign a descriptive name and description to the task. It is also important to enable the "Run whether user is logged on or not" setting.

Navigate to the "Triggers" tab and establish a new trigger. Configure this trigger to initiate the task upon user logon, applying to all users.

Switch to the "Actions" tab and define a new action. This action will execute the sendemail.exe application, utilizing arguments similar to the following:
-f from@gmail.com -t to@gmail.com -u Someone Logged Into Your Computer -m Someone just logged into your computer! -s smtp.gmail.com:587 -xu from@gmail.com -xp password -o tls=yes
The provided arguments configure an email to be sent from from@gmail.com to to@gmail.com. The email subject will be "Someone Logged Into Your Computer," and the message content will read "Someone just logged into your computer!". The SMTP server details are set to smtp.gmail.com on port 587; adjust these if your email provider differs.

Alternatively, if you have access to an SMTP server that doesn't require authentication, you may choose the "Send an email" action directly.
On the "Conditions" tab, ensure the "Start the task only if the computer is on AC power" option is unchecked. Otherwise, you may not receive notifications when using a laptop on battery power.

Confirm your settings by clicking "OK" and saving the task. Email notifications will now be sent whenever a user logs into the computer.

The sendemail.exe utility can be utilized with other trigger events to automate various email notifications. For instance, scheduled emails or alerts based on specific Windows event log entries can be configured.