Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Last Login

Status
Not open for further replies.

richf6

Programmer
Mar 1, 2002
6
US
I have an NT4.0 domain. I am trying to find out what the last login date is for all my users in user manager. I cannot find this date. Does anybody know how to get it?

Thanks[bigears]
Rich Friedel
 
Try this. You can still use ADSI in a WINNT environment.

Set user = GetObject(&quot;WinNT://<domain>/<username>&quot;)
wscript.echo user.lastlogin

Dana Hallenbeck
 
Dana, I have tried that but I get the following error &quot;Active Directory: The Active Directory Property Cannot be Found in the Cache&quot;.

Rich Friedel
 
Are you running this from an NT 4.0 workstation? If so, do you have ADSI installed on it? Do you have the administrative rights?

Dana Hallenbeck
 
Dana, I'm running on a W2K Pro workstation with SP2.

Rich Friedel
 
Try it on multiple accounts...if you are not already. See if you get data on any of them. Do you get other properties if you query them(ie - user.fullname, user.name, etc.)

Try making the query more specific:

Set user = GetObject(&quot;WinNT://<domain>/<username>,user&quot;)
wscript.echo user.get(&quot;lastlogin&quot;)

Dana Hallenbeck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top