I'm trying to retireve USER_LAST_LOGOFF on a one domain controller test domain using the
following:

use Win32::AdminMisc;

my ($User) = "Miles";
my ($Server) = "DORIAN";
my  ( %Elements);

if ( Win32::NetAdmin::UserGetAttributes( $Server, $User, \%Elements)) {
         print "Last Logon of $User was $Elements{USER_LAST_LOGON}\n";
                print "Last Logon of $User was $Elements{USER_LAST_LOGOFF}\n";
}else {
         die "We failed to get elements\n";
}

I receive a value for USER_LAST_LOGON, but always receive a Zero for USER_LAST_LOGOFF, and yes, the user has been logged on and of the domain.

My question is why is USER_LAST_LOGOFF always Zero. Is there something I need to enable on the server?

Brian Sheffield

Reply via email to