Hi Joe, 

Quick question, I have always just used the NET USER /DOM (username ) at a 
command prompt which gives me the following output:
----------------------------
C:\Documents and Settings\jmedeiros>net user /dom jmedeiros
The request will be processed at a domain controller for domain 
Stargate.sg1.net.

User name                    jmedeiros
Full Name                    Medeiros, Jose
Comment
User's comment
Country code                 000 (System Default)
Account active               Yes
Account expires              Never

Password last set            3/16/2005 6:52 PM
Password expires             6/14/2005 6:52 PM
Password changeable          3/16/2005 6:52 PM
Password required            Yes
User may change password     Yes

Workstations allowed         All
Logon script                 CISCO123.bat
User profile
Home directory
Last logon                   5/27/2005 12:57 PM

Logon hours allowed          All

-------
However If I wanted to use this complex VBscript to do the same thing tyhat a 
simple dos command can do, how would I add a wildcard to this vbscript that 
show's all the user logons and have it dump the output in a text file?

Regards, 

Jose Medeiros

-------------------------------------------------------------------------

, but if I wanted to use this vbscript to give 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of joe
Sent: Friday, May 27, 2005 12:47 PM
To: [email protected]
Subject: RE: [ActiveDir] lastlogontimestamp


Split the difference, grab adfind from www.joeware.net in the free windows 
tools section and see what it decodes the values to. I can't speak to acctinfo 
dll as I never used it. Vbscript decoding of int8 values is often troublesome, 
it is possible the code below isn't doing a very accurate decode, I haven't 
checked it. I can guarantee adfind is doing it well with the possible debate 
around DST issues and what really should be displayed (should it be a value 
that was accurate at the time or a value accurate after a DST switch). 

The most accurately returned values I have seen for vbscript have been out of 
code Richard Mueller has put together.

  joe




From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Smith, Robin
Sent: Friday, May 27, 2005 2:31 PM
To: '[email protected]'
Subject: [ActiveDir] lastlogontimestamp


Hi. Our domain is at the Windows 2003 server functional level. I have 
registered acctinfo.dll from the 2003 resource kit and have the Additional 
Account Info tab in ADUC. I am finding a big discrepancy between the 
lastlogontimestamp date on the Additional Account Info tab and the actual 
lastlogontimestamp date. For example, John Doe shoes a lastlogontimestamp of 
11/23/04 in ADUC. However, if I execute the following script:
 
Set objUser = GetObject("LDAP://cn=John Doe, ou=MOET (g14), ou=Field Users, 
ou=LWD Accounts, dc=njdol, dc=ad, dc=dol")
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#
 
(code was taken from here: 
http://www.microsoft.com/technet/scriptcenter/topics/win2003/lastlogon.mspx)
 
I get a much more current date (5-25-05). This is happening with more than one 
user. Any explanation for why this happens. I've done a lot of reading this 
week and I understand that the lastlogontimestamp field could be off by 7-10 
days but this is several months.
 
Thanks,
Robin
NJDOL
 

List info   : http://www.activedir.org/List.aspx
List FAQ    : http://www.activedir.org/ListFAQ.aspx
List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/

Reply via email to