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.
|
|