Last logon times 
Author Message
 Last logon times

Hi,

Is there an easy way to pull the last logon time of an NT user account?

I can get the list of NT users in question but I don't know what property
I'm looking for.

Any help appreciated.

Thanks, Neil.



Sun, 09 Dec 2001 03:00:00 GMT  
 Last logon times
LastLogin

Here's what I use to "snoop"...

vDomain = InputBox("Enter domain",,"domainname")
if vDomain = "" then WScript.quit
vUser = InputBox("Enter username",,"username")
if vUser = "" then WScript.quit
Set oDomain = GetObject("WinNT://" & vDomain)
set oUser = oDomain.GetObject("User" , vUser)
oUser.GetInfo
on error resume next
s = s & "Class: " _
      & oUser.Class & vbCrLf
s = s & "Name: " _
      & oUser.Name & vbCrLf
s = s & "FullName: " _
      & oUser.FullName & vbCrLf
s = s & "PasswordExpirationDate: " _
      & oUser.PasswordExpirationDate & vbCrLf
s = s & "IsAccountLocked: " _
      & oUser.IsAccountLocked & vbCrLf
s = s & "LastLogin: " _
      & oUser.LastLogin & vbCrLf
s = s & "==========================" & vbCrLf
for i = 1 to oUser.PropertyCount
 set prop = oUser.Next
 s = s & prop.name & "=" & oUser.Get(prop.name) & vbCRLF
next
msgbox s

--
Michael Harris


| Hi,
|
| Is there an easy way to pull the last logon time of an NT user account?
|
| I can get the list of NT users in question but I don't know what property
| I'm looking for.
|
| Any help appreciated.
|
| Thanks, Neil.
|
|



Sun, 09 Dec 2001 03:00:00 GMT  
 Last logon times
Thanks Michael,

Much appreciated, Neil.


Quote:
> LastLogin

> Here's what I use to "snoop"...

> vDomain = InputBox("Enter domain",,"domainname")
> if vDomain = "" then WScript.quit
> vUser = InputBox("Enter username",,"username")
> if vUser = "" then WScript.quit
> Set oDomain = GetObject("WinNT://" & vDomain)
> set oUser = oDomain.GetObject("User" , vUser)
> oUser.GetInfo
> on error resume next
> s = s & "Class: " _
>       & oUser.Class & vbCrLf
> s = s & "Name: " _
>       & oUser.Name & vbCrLf
> s = s & "FullName: " _
>       & oUser.FullName & vbCrLf
> s = s & "PasswordExpirationDate: " _
>       & oUser.PasswordExpirationDate & vbCrLf
> s = s & "IsAccountLocked: " _
>       & oUser.IsAccountLocked & vbCrLf
> s = s & "LastLogin: " _
>       & oUser.LastLogin & vbCrLf
> s = s & "==========================" & vbCrLf
> for i = 1 to oUser.PropertyCount
>  set prop = oUser.Next
>  s = s & prop.name & "=" & oUser.Get(prop.name) & vbCRLF
> next
> msgbox s

> --
> Michael Harris



> | Hi,
> |
> | Is there an easy way to pull the last logon time of an NT user account?
> |
> | I can get the list of NT users in question but I don't know what
property
> | I'm looking for.
> |
> | Any help appreciated.
> |
> | Thanks, Neil.
> |
> |



Mon, 10 Dec 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. How to access Exchange "Last Logon Time" ???

2. Last Logon

3. User's Last Logon

4. Last logon for NT machine

5. Retrieve Last Logon via Active Directory

6. How do I the default page in IIS to show last file date and time

7. Printer taking a long time to print last page

8. NT Domain Last User Login time

9. script to show Last User logon time, not working right??

10. Change the Last Modify and Last Access date

11. set time in logon script

12. Logon Date/Time Script Won't Run

 

 
Powered by phpBB® Forum Software