
BillKSmith
Veteran
Apr 20, 2010, 10:35 AM
Post #2 of 2
(4439 views)
|
|
Re: [mmahesh_mca] How to get the windows user login time
[In reply to]
|
Can't Post
|
|
You misunderstood the definition of "logonHours". The array which you printed indicates that you have permission to logon at any time. The parameter that you want does not seem to be directly available. It can be computed from by subtracting "lastLogon" from time(). use strict; use warnings; use Win32API::Net qw(UserGetInfo); my $Server = q(); my $Userid = q(mahesh); my $Level = 2; my %UserInfo; UserGetInfo($Server, $Userid, $Level, \%UserInfo); print q(time since login: ), time(), qq( - $UserInfo{lastLogon} = ), time() - $UserInfo{lastLogon}, q( seconds), qq(\n); ; I have tested this program with ActiveState 5.8.8 and Win32API::New '0.01' under XP HOME Good Luck Good Luck, Bill
(This post was edited by BillKSmith on Apr 20, 2010, 11:42 AM)
|