Solved

2003 AD Domain , last logon time

Posted on 2013-01-18
5
808 Views
Last Modified: 2013-01-27
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?
0
Comment
Question by:Jason Thomas
  • 2
  • 2
5 Comments
 
LVL 35

Assisted Solution

by:Ernie Beek
Ernie Beek earned 100 total points
Comment Utility
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
0
 
LVL 1

Author Comment

by:Jason Thomas
Comment Utility
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?
0
 
LVL 35

Expert Comment

by:Ernie Beek
Comment Utility
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.
0
 
LVL 3

Accepted Solution

by:
jeorge earned 400 total points
Comment Utility
Hello!
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

http://www.winserverkb.com/Uwe/Forum.aspx/windows-server-ad/19958/OldCMP-last-logon-timestamp-and-domain-controllers

or a VB scripts for
http://www.rlmueller.net/Last%20Logon.htm

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

http://www.lepide.com/last-logon-reporter.html

Hope it works for you.
0
 
LVL 1

Author Closing Comment

by:Jason Thomas
Comment Utility
Thanks chaps.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Mapping Drives using Group policy preferences Are you still using old scripts to map your network drives if so this article will show you how to get away for old scripts and move toward Group Policy Preference for mapping them. First things f…
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now