what is the windows event id for smartcard removal
- User
what is the windows event id for smartcard removal
Assistant
The Windows Event ID for smart card removal is typically 4602, found in the Security log. This event indicates that a logon session was terminated, which occurs when a smart card is removed (if the system is configured to terminate the session upon removal).
Key Details:
- Event ID: 4602
- Log Type: Security (Audit Success)
- Description: "A logon session was terminated."
- Common Cause: Smart card removal triggers the termination of the associated interactive logon session.
Example Scenario:
- A user logs in with a smart card (Event ID 4624 for logon).
- When the smart card is removed, the system logs Event ID 4602 to indicate the session ended.
Notes:
- Ensure audit policies are configured to log logon session terminations (via Group Policy: Computer Configuration > Windows Settings > Security Settings > Advanced Audit Policy).
- For hardware-level device removal (e.g., the physical smart card reader being unplugged), check System logs for Plug and Play events (e.g., Event ID 11).
If you're troubleshooting, cross-reference this event with other logon-related events (e.g., 4601 for session initialization or 4624 for successful logons).
- User
no, its not used for logon. i want to know when a smartcard is removed
Assistant
If you're looking to detect when a smart card is physically removed from a reader (not related to logon sessions), Windows does not log a direct, dedicated Event ID for this action by default. However, you can use the following approaches to identify smart card removal events:
1. System Log (Plug and Play Events)
- Event ID 11 ("Device Removal") in the System log may indicate the removal of the smart card reader itself (e.g., if the reader is unplugged from USB).
- Not for the card itself: This does not track the removal of the smart card from the reader unless the reader hardware explicitly signals the card's removal as a device change (uncommon for most readers).
2. Smart Card Service Logs
- The Smart Card (SCardSvr) service logs events related to smart card operations. Check these logs:
- Path:
Event Viewer > Windows Logs > System - Source:
Smart CardorMicrosoft-Windows-SmartCardLogon
- Path:
- Example Event IDs (may vary by OS version):
- 11307: "The smart card has been removed."
- 11308: "The smart card has been inserted."
- These events are logged if verbose logging is enabled (see below).
3. Enable Verbose Logging for Smart Card Events
To capture detailed smart card events (like removal), enable Microsoft-Windows-SmartCardLogon logging:
- Open Event Viewer (
eventvwr.msc). - Navigate to:
Applications and Services Logs > Microsoft > Windows > SmartCardLogon > Operational - Right-click the log and select Enable Log.
- After enabling, insert/remove the smart card and check for events like:
- Event ID 11307: Card removed.
- Event ID 11308: Card inserted.
4. Use Sysmon (System Monitor) for Device Monitoring
- Sysmon (from Sysinternals) can track smart card reader activity if configured to log device events.
- Example rule in Sysmon config:
<RuleGroup name="Smart Card Monitoring"> <DeviceChangeEvent onmatch="include"/> </RuleGroup> - This will log Event ID 16 (device removal) for the reader or card, depending on hardware support.
5. Custom Scripts/Applications
If built-in logging is insufficient, use APIs like PC/SC (via
winscard.dll) or PowerShell/.NET to monitor smart card states programmatically. For example:$context = New-Object -ComObject SCard.Context $context.Establish([int32]2) # SCARD_SCOPE_SYSTEM $readers = $context.ListReaders() foreach ($reader in $readers) { $status = $context.GetStatus($reader) Write-Host "$reader - $($status.State)" }
Summary Table:
Method Event ID Description System Log 11 Reader removal (not the card itself). SmartCardLogon Log 11307 Card removed (if verbose logging is enabled). Sysmon 16 Device removal (reader/card, hardware-dependent).
Final Notes:
- Most systems do not log smart card removal events by default. You’ll need to enable verbose logging or use tools like Sysmon for granular tracking.
- If the smart card is used for logon, Windows will still log Event ID 4602 (session termination), but this is tied to authentication, not hardware removal.
Let me know if you need help enabling logging or configuring Sysmon!
- User
what its the correct id , 610 or 11307
Assistant
The correct Event ID for smart card removal (not tied to logon) is 11307, not 610. Here's the breakdown:
✅ Event ID 11307
- Log Path:
Event Viewer > Applications and Services Logs > Microsoft > Windows > SmartCardLogon > Operational - Description:
"The smart card has been removed." - Requirements:
You must enable the Operational log forMicrosoft-Windows-SmartCardLogonto see this event. By default, it is disabled.
❌ Event ID 610
- Log Type: System Log (Security)
- Description:
"The audit log was cleared." (e.g., when an administrator clears the Security log). - Not Related:
This has nothing to do with smart card removal.
How to Enable SmartCardLogon Operational Logging
- Open Event Viewer (
eventvwr.msc). - Navigate to:
Applications and Services Logs > Microsoft > Windows > SmartCardLogon > Operational - Right-click Operational and select Enable Log.
- After enabling, remove a smart card from its reader.
- Refresh the log and look for:
- Event ID 11307: Card removed.
- Event ID 11308: Card inserted.
Summary
- Use 11307 for tracking physical smart card removal (requires enabling the log).
- Ignore 610 — it’s unrelated to smart cards.
Let me know if you need further help enabling the log or interpreting the events!
- Log Path:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.