Go Back   TechArena Community > Technical Support > Computer Help > Windows Server > Active Directory
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



dsquery for users last logon time???

Active Directory


Reply
 
Thread Tools Search this Thread
  #1  
Old 07-07-2005
Member
 
Join Date: Nov 2004
Posts: 47
dsquery for users last logon time???

Hope you guys understood from my Subject line what I want to know. I have already tried searching for the same on web but dint found a working solution. So if anyone of you have any idea about any dsquery parameters to find out the last time a user was
logged on, please let me know as well.

Thanks for the helps.

Reply With Quote
  #2  
Old 07-07-2005
Member
 
Join Date: Sep 2004
Posts: 150
Re: dsquery for users last logon time???

The dsquery should be probably like this:

Quote:
C:\>dsquery * "cn=paul williams,ou=test,dc=2k3dom,dc=com" -scope base -attr
lastLogonTimestamp
However, that value isn't very readable. You'd be better off using something like this VB Script:

Quote:
Set objUser = GetObject("LDAP://cn=Ken Myer, ou=Finance, dc=fabrikam,
dc=com")
Set objLastLogon = objUser.Get("lastLogonTimestamp")

intLastLogonTime = objLastLogon.HighPart * (2^32) + objLastLogon.LowPart
intLastLogonTime = intLastLogonTime / (60 * 10000000)
intLastLogonTime = intLastLogonTime / 1440

Wscript.Echo "Last logon time: " & intLastLogonTime + #1/1/1601#
See if it helps.
Reply With Quote
  #3  
Old 08-07-2005
Member
 
Join Date: Nov 2004
Posts: 47
Re: dsquery for users last logon time???

I appreciate your help friend but when i tried running the same it gives me the following error message:

You are connected to a domain that does not support this query.

Now What? I just want an easiest command that can display user account
activity. Thanks again.
Reply With Quote
  #4  
Old 09-07-2005
Member
 
Join Date: Jan 2006
Posts: 4,215
Re: dsquery for users last logon time???

No problem. A lot of people asked for it, so we got it. I just wish I could use it; but almost all of our customers are running 2000/ NT ;-)
Reply With Quote
  #5  
Old 13-07-2005
Member
 
Join Date: Oct 2005
Posts: 2,357
Re: dsquery for users last logon time???

As far as i know the command you are trying to run needs Windows Server 2003 domain in domain functional mode.
Reply With Quote
Reply

  TechArena Community > Technical Support > Computer Help > Windows Server > Active Directory
Tags:



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "dsquery for users last logon time???"
Thread Thread Starter Forum Replies Last Post
User dsquery to obtain lanid, name for all users in the domain. bigboy Active Directory 2 30-04-2009 10:45 PM
Remote Web Workplace Will not Allow Users to Logon Victor Kam Small Business Server 5 18-04-2009 04:11 AM
DSQUERY: list users created after a specific date AndieB Active Directory 2 27-11-2008 01:05 AM
List of Last Logon Time with dsget/dsquery Viensterrr Active Directory 1 17-09-2008 06:36 PM
users' last-logon-timestamp HenrikK Active Directory 4 06-03-2008 10:04 PM


All times are GMT +5.5. The time now is 10:06 PM.