Sometimes, you may be required to check who has logged into your computer while you were away. You can do so by using an event viewer on your computer.
These steps are for Windows 8.1, but should almost be the same for Windows 7 and Windows 10.
Enable Logon Auditing
Step 1: Press Windows icon key + X and scroll down the menu. Click on Run.
Step 2: Type in gpedit.msc and press enter to start the policy editor.
Step 3: Go to the following path:
Local Computer Policy –> Computer Configuration –> Windows Settings –> Security Settings –> Local Policies –> Audit Policy
Step 4: Find the Audit logon events policy.
Step 5: Right-click and then click on Edit.
View Logon Events
Step 1: Open the Windows event viewer.
Step 2: Go to Event Viewer (Local) -> Windows Logs –> Security category in the event viewer
Step 3: Look for events with event ID 4624 or 4672
Step 4: Double-click the event and scroll the text box. You will see the login information.