iadsuser.lastlogoff?

iadsuser.lastlogoff?

Post by mrco.. » Tue, 24 Oct 2000 04:00:00



If my code can read user.lastlogin, why can't it read user.lastlogoff?
The user I am reading has certainly logged off at least once in his
history. The documentation doesn't say that some of them don't really
work!!  Using NT4 SP6 ADSI 2.5 (Domain controller is running Win2000
SP1)

Of all the user properties that VB tells me are available in the
iAdsUser interface, only about half of them work.  What's up with that?!

I am using the WinNT provider.

Here's the output-
---------------------------
user.FullName=Anderson, Geoff
Error -2147463155 - The Active Directory property cannot be found in
the cache.

user.PasswordMinimumLength=0
Error -2147463155 - The Active Directory property cannot be found in
the cache.

user.IsAccountLocked=False
user.AccountDisabled=False
user.LastLogin=10/23/00 4:37:45 PM
Error -2147463155 - The Active Directory property cannot be found in
the cache.

Error -2147463155 - The Active Directory property cannot be found in
the cache.

Here's the code-
--------------------------
Private Sub Command9_Click()
    On Error GoTo bounce
    Dim user As IADsUser
    Dim username As String
    Dim userdomain As String
    userdomain = TxtDomain.Text
    username = TxtUserID.Text
    Set user = GetObject("WinNT://" & userdomain & "/" & username
& ",user")
    Dim retval As String
    Bark "user.FullName=" & user.FullName
    Bark "user.Title=" & user.Title
    Bark "user.PasswordMinimumLength=" & user.PasswordMinimumLength
    Bark "user.AccountExpirationDate=" & user.AccountExpirationDate
    Bark "user.IsAccountLocked=" & user.IsAccountLocked
    Bark "user.AccountDisabled=" & user.AccountDisabled
    Bark "user.LastLogin=" & user.LastLogin
    Bark "user.LastLogoff=" & user.LastLogoff
    Bark "user.LastFailedLogin=" & user.LastFailedLogin
    Exit Sub
bounce:
    Bark "Error " & Err.Number & " - " & Err.Description
    Resume Next
End Sub

Regards,
Geoff

Sent via Deja.com http://www.deja.com/
Before you buy.