Audit User LogOff Event
To turn on auditing so that Windows logs user logoff events (like Event ID 4634 and 4647), you need to enable audit policies in the Local Security Policy or through Group Policy.
Method 1: Enable Auditing via Local Security Policy
Steps:
Open Local Security Policy
Press
Win + R
, typesecpol.msc
, and hit Enter
Navigate to:
Security Settings > Local Policies > Audit Policy
On the right side, double-click the following policy:
Audit logon events
In the dialog box:
Check both Success and Failure
Click OK
This enables logging of both logon (4624) and logoff (4634) events.
Method 2: Enable via Group Policy (Domain Environment)
If you're in a domain or managing multiple servers:
Open Group Policy Management Editor (
gpmc.msc
)Navigate to:
Computer Configuration > Policies > Windows Settings > Security Settings > Local Policies > Audit Policy
Set "Audit logon events" to Success and Failure
Optionally, enable "Audit account logon events" as well
Run
gpupdate /force
on the target VM to apply the policy immediately.
To Confirm It's Working:
After a user logs off, go to Event Viewer:
Windows Logs > Security
Look for:
Event ID 4634 – Account logoff
Event ID 4647 – User-initiated logoff
REFERENCES
Last updated
Was this helpful?