Introduction
Recently, Windows 11 users have reported an issue where the operating system starts logging every time they lock their machine using the Win+L shortcut. This issue occurs even when no apps are running, and it can be quite intrusive, especially if you value your privacy.
Understanding the Problem
The issue seems to be related to the Windows PowerShell Scripting Engine (PSE) and its PowerShell Core (Pwsh.exe) component. These components are responsible for running scripts and automating tasks in Windows. When you lock your machine using the Win+L shortcut, the system runs a PowerShell script that logs various events.
However, in some cases, this script may continue to run even after you've locked your machine or closed apps. This can lead to unnecessary logging and increased resource usage.
Diagnosing the Issue
To diagnose the issue, you can check the following:
- Check the Event Viewer for any unusual events related to PowerShell or the Win+L shortcut.
- Use the Task Manager to check if any PowerShell processes are running after you've locked your machine or closed apps.
Solutions
There are a few potential solutions to this issue:
Solution 1: Disable PowerShell Scripting
You can disable PowerShell scripting to prevent the script from running when you lock your machine. Here's how:
- Press Win+R to open the Run dialog box.
- Type "gpedit.msc" and press Enter.
- Navigate to "User Configuration" > "Administrative Templates" > "Windows Components" > "Windows PowerShell."
- Double-click "Prevent execution of scripts and scripts signed with a certificate that fails verification" and set it to "Enabled."
- Click "OK" to save the changes and close the Local Group Policy Editor.
Solution 2: Use a Third-Party Lock Screen
You can also use a third-party lock screen app to replace the default Windows lock screen. These apps don't use the Win+L shortcut or run PowerShell scripts when you lock your machine.
Solution 3: Use Group Policy to Disable PowerShell Scripting
If you're using a domain-joined machine, you can use Group Policy to disable PowerShell scripting for all users.
- Press Win+R to open the Run dialog box.
- Type "gpedit.msc" and press Enter.
- Navigate to "Computer Configuration" > "Administrative Templates" > "Windows Components" > "Windows PowerShell."
- Double-click "Prevent execution of scripts and scripts signed with a certificate that fails verification" and set it to "Enabled."
- Click "OK" to save the changes and close the Local Group Policy Editor.
The Windows 11 PCK issue that causes unnecessary logging when you lock your machine or close apps can be quite frustrating. However, by following the solutions outlined above, you can disable PowerShell scripting or use a third-party lock screen app to prevent the issue from occurring.
- Microsoft Docs - gpedit.msc
- How-To Geek - Third-Party Lock Screens