Enforce Smart Card Removal Lock via Regedit
Enforcing a smart card removal policy ensures that a Windows
workstation automatically locks the moment a user disconnects their
physical smart card. This article explains how administrators can
configure the Windows Registry (regedit) to set the smart
card removal behavior to immediately lock the desktop, as well as ensure
the required background service is enabled to process the event.
Step 1: Configure the Winlogon Smart Card Removal Action
To define the action Windows takes when a smart card is removed,
modify the Winlogon registry key:
- Press
Win + R, typeregedit, and press Enter to open the Registry Editor. - Navigate to the following path:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon - Locate or create a String Value (
REG_SZ) namedScRemoveOption. - Double-click
ScRemoveOptionand set its Value data to1.- 0 = No action
- 1 = Lock Workstation (Locks the desktop immediately)
- 2 = Force Logoff
- 3 = Disconnect Remote Desktop Session
Step 2: Enable the Smart Card Removal Policy Service
The registry configuration requires the Smart Card Removal
Policy service (SCPolicySvc) to be running. If
this service is disabled or stopped, the removal trigger will not
function.
You can set this service to start automatically via the registry:
- Navigate to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SCPolicySvc - Locate the
StartDWORD (REG_DWORD) value. - Double-click
Startand change the value data to2(Automatic).- 2 = Automatic
- 3 = Manual
- 4 = Disabled
Step 3: Apply and Test the Changes
Open an elevated Command Prompt or PowerShell and start the service immediately:
net start SCPolicySvcAlternatively, restart the computer to apply both registry modifications.
Log in using a smart card, then remove the card from the reader. The desktop should lock immediately.