find Last 5 Logon on windows

Mehan CO
Mehan CO used Ask the Experts™
on
with below command i can found last Logon for user Test on my windows :

net user test /domain

now i need find for example last 5 Last logon for user test .

how can i figure it out ?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
I am using this one which really helps me lot for lot of login info.. I would suggest customize to your environment and use the same to get the details. Script https://gallery.technet.microsoft.com/scriptcenter/Find-user-logon-duration-667b8c48
There are a few options:

1. You could troll the security logs on each of your DCs, then manually or using some tool parse the events and try to piece together what has happened. A login may be recorded on and DC, and if the machine had no connection at login, there will be nothing on any DC. It can be a PITA.

2. Beforehand, compile a pair of simple scripts and deploy it as a logon/logoff scripts via a GPO, to write login events to a hidden file share. This way, anyone granted access can see login and logoff events. The scripts I use is below:
echo Logon,%DATE%,%TIME%,%COMPUTERNAME% >> \\dc01\onofflogs$\%USERNAME%.txt

Open in new window

echo Logoff,%DATE%,%TIME%,%COMPUTERNAME% >> \\dc01\onofflogs$\%USERNAME%.txt

Open in new window


This creates a nice little text file for each user, detailing each logon and logoff event, with a time and date stamp, as well as the machine name.
E ATech Lead
Commented:
Start Command Prompt.
Enter cd C:\Windows\system32 and press Enter.
Then write quser and press Enter.

However, the login/logout times can be found under the Security section of Windows Logs in Event Viewer. It's worth looking around on Event Viewer to find other information you require.

https://answers.microsoft.com/en-us/windows/forum/windows_7-security/how-do-i-view-login-history-for-my-pc-using/a0172887-1071-47fb-b0a3-6ca9360efdbf

You may also get help from free last logon reporter solutions like; Lepide and Manageengine.

Hope this helps!
Mark BillExchange, AD, SQL, VMware, HPE, 3PAR, FUD, Anti MS Tekhnet, Pro EE, #1

Commented:
free trial of solarwinds log and event manager, great for this stuff.
Shared details, If still expert looking for more details then he can object.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial