• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 849
  • Last Modified:

2003 AD Domain , last logon time

Hey dudes, trying to find out the last known logon time for a user on the domain using the net user command but keep getting syntax errors. Anyone able to provide the correct syntax please?
Jason Thomas
Jason Thomas
  • 2
  • 2
2 Solutions
Ernie BeekExpertCommented:
I don't think net user will give accurate results. There are other scripts to do that though: http://community.spiceworks.com/scripts/show/369-last-login-by-user
Jason ThomasAuthor Commented:
I will not be able to install the app on the end of that link and I cannot decipher the script, it appears to do a lot more than what I require.

Thanks anyway, anyone else got any ideas please?
Ernie BeekExpertCommented:
Well, this works for me:

net user anyuser /domain
The request will be processed at a domain controller for domain xxx.local.

User name                    anyuser
Full Name                    Beek, Ernie
Comment                      xxx
User's comment
Country code                 (null)
Account active               Yes
Account expires              Never

Password last set            8-10-2009 8:40:45
Password expires             Never
Password changeable          8-10-2009 8:40:45
Password required            Yes
User may change password     Yes

Workstations allowed         All
Logon script                 logon.bat
User profile
Home directory               \\xxx.local\etcetera
Last logon                   18-1-2013 12:40:18

Logon hours allowed          All

Local Group Memberships      lots
Global Group memberships     evenmore
The command completed successfully.

Open in new window

Keep in mind though that the "lastLogon" attribute is not replicated, a different value is
stored on each Domain Controller (DC) for each user or computer.
i think it depends on what type of ad you are doing this.
if this is a 2003 then it's a bit difficult!
for each user you'll have to check on every DC for the lastlogontimestamp (if i recall correctly) and get the most recent entry. Why ? because this attribute is not replicated betweed DCs.

Read this thread


or a VB scripts for

Else if you want you can go for a third party freeware tool such as


Hope it works for you.
Jason ThomasAuthor Commented:
Thanks chaps.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now