What is the event id in Event Viewer for lock, unlock for a computer in Windows XP, Windows 7, Windows Vista and Windows Server 2008?
For newer versions of Windows (including but not limited to both Windows 10 and Windows Server 2016), the event IDs are:
Locking and unlocking a workstation also involve the following logon and logoff events:
When using a Terminal Services session, locking and unlocking may also involve the following events if the session is disconnected, and event 4778 may replace event 4801:
Events 4800 and 4801 are not audited by default, and must be enabled using either Local Group Policy Editor (gpedit.msc) or Local Security Policy (secpol.msc).
The path for the policy using Local Group Policy Editor is:
The path for the policy using Local Security Policy is the following subset of the path for Local Group Policy Editor: