Determine user’s last logon date/time

30 pts.
Tags:
Scripts
Windows Security
Windows XP
Hello guys/gals!

I have what I hope is a pretty straight forward question.  I have several WinXP Pro machines (non AD domain; all machines are in a workgroup).  I would like to run a script after the user authenticates that will display the last date/time he/she logged into the computer.  All login events are logged into the security logs.  All of the scripts I'm finding relate heavily with doing this with a PDC/BDC within an AD environment. 

Can this be acheived?  Thanks in advance for everyone's time and support!

Mike



Software/Hardware used:
Windows XP Pro

Answer Wiki

Thanks. We'll let you know when a new response is added.

Here are the steps to get a logon script to work on the local machine:
1. Create a new folder that will contain your logon scripts (can be anywhere and any name)
2. Share the folder and the share name must be “netlogon”
3. Create your script:
echo logon %username% %computername% %date% %time% >> C:\logon.log
4. Save the script as a .bat file like script.bat.
5. Place the script in the shared folder
6. Go to Computer Management -> Local users and Groups
7. Double click on the username that logs into the computer
8. In the Profile tab, put the name of your script, script.bat, in the Logon Script field. You don’t need a path just the script name if it is located in the netlogon share.
9. Log out and logon as that user.

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Mgrass
    Thanks mshen. Likely what I will do is link the script to execute within the registry such that it is forced to run when a user is logged in. What I'm looking for, in particular, is the script itself not the deployment. I really appreciate you taking a few moments of your time to reply to my question.
    30 pointsBadges:
    report
  • mshen
    No Problem. Step 3 is all you need then.
    27,385 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following