find Last 5 Logon on windows

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 ?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Sekar ChinnakannuStaff EngineerCommented:
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
Mal OsborneAlpha GeekCommented:
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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ajit SinghCommented:
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.

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, #1Commented:
free trial of solarwinds log and event manager, great for this stuff.
Sekar ChinnakannuStaff EngineerCommented:
Shared details, If still expert looking for more details then he can object.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows OS

From novice to tech pro — start learning today.