Monitoring when a Windows computer is unlocked can be useful for security, parental control, workplace auditing, or personal awareness. Windows 11 does not provide a built-in option to send email notifications when a user unlocks the system, but this functionality can be achieved using Windows security logs combined with Task Scheduler and a simple script.
When a Windows PC is unlocked, the event is recorded in the Windows Security Event Log. By creating a scheduled task that triggers on this event and sends an email, you can automatically receive notifications whenever the system is accessed.
Setting this up requires administrator access and a one-time configuration. Once completed, Windows will silently monitor unlock events and notify you by email whenever the computer is unlocked. The steps below explain the complete setup process.
How to Receive Email Notification When Your Windows Computer Is Unlocked
The methods in this section explain how to track unlock events and send an email alert using built-in Windows tools. Follow the steps carefully to ensure reliable notifications.
Before proceeding, make sure auditing is enabled and you have access to an email account that supports SMTP.
1. Enable Audit Logon Events in Windows
Windows must record unlock events before they can be detected.
- Press Windows + R, type
secpol.msc, and press Enter. - Go to Advanced Audit Policy Configuration.
- Expand System Audit Policies.
- Select Logon/Logoff.
- Double-click Audit Logon.
- Check Success.
- Click OK.
This ensures Windows logs unlock-related events.
2. Confirm Unlock Events Are Being Logged
Verify that Windows is recording unlock activity.
- Press Windows + X and open Event Viewer.
- Go to Windows Logs > Security.
- Look for Event ID 4624 with Logon Type 7.
- Confirm new events appear when the system is unlocked.
Logon Type 7 indicates workstation unlock events.
3. Create a PowerShell Script to Send Email
Windows will use a script to send the email alert.
- Open Notepad.
- Paste the following script and customize email details:
Send-MailMessage `
-To "your@email.com" `
-From "your@email.com" `
-Subject "Windows PC Unlocked" `
-Body "Your Windows computer was unlocked on $(Get-Date)." `
-SmtpServer "smtp.yourprovider.com" `
-Port 587 `
-UseSsl `
-Credential (Get-Credential)
- Save the file as
unlock-alert.ps1. - Store it in a permanent location such as
C:\Scripts.
Use an app-specific password if required by your email provider.
4. Create a Scheduled Task Triggered by Unlock Event
This task runs the script automatically.
- Press Windows + R, type
taskschd.msc, and press Enter. - Click Create Task.
- Name the task clearly, such as Unlock Email Alert.
- Enable Run with highest privileges.
- Go to the Triggers tab.
- Click New.
- Select On an event.
- Set:
- Log: Security
- Source: Microsoft-Windows-Security-Auditing
- Event ID: 4624
- Click OK.
This links the task to unlock events.
5. Add a Filter for Unlock Events Only
Limit the task to unlock actions.
- In the Triggers tab, click Edit.
- Click Custom > New Event Filter.
- Go to the XML tab.
- Enable Edit query manually.
- Use a filter that checks for LogonType 7.
- Save the filter.
This prevents emails for normal logins.
6. Attach the PowerShell Script to the Task
Now configure the action.
- Go to the Actions tab.
- Click New.
- Choose Start a program.
- Program/script:
powershell.exe - Add arguments:
-ExecutionPolicy Bypass -File "C:\Scripts\unlock-alert.ps1" - Start in:
C:\Scripts - Click OK.
This runs the email script automatically.
7. Configure Conditions and Settings
Ensure the task runs reliably.
- Open the Conditions tab.
- Disable power-related restrictions if needed.
- Go to the Settings tab.
- Enable Allow task to be run on demand.
- Enable Run task as soon as possible after a scheduled start is missed.
- Click OK.
These options improve reliability.
8. Test the Email Notification
Always verify the setup.
- Lock your computer using Windows + L.
- Unlock the system.
- Check your email inbox.
- Confirm the notification was received.
If no email arrives, review Task Scheduler history.
Final Thoughts
Receiving an email notification when your Windows computer is unlocked is a powerful way to monitor system access using built-in Windows features. By combining audit logs, Task Scheduler, and a simple PowerShell script, you can create a reliable alert system without installing third-party software.