Nar has asked for the wisdom of the Perl Monks concerning the following question:
From reviewing the VBS it appears that the problem is where I am calling the $wmi_call->execute(); When it was done in VBS the call was made like thisuse DBI; my $computer = "."; my $dbh_connect = DBI->connect("dbi:WMI:$computer"); my $wmi_call = $dbh_connect->prepare(<<WQL); Select * from Win32_LogonSession Where LogonType = 2 OR LogonType += 10 WQL $wmi_call->execute(); while (defined (my $row = $wmi_call->fetchrow_arrayref())) { my $ev = $row->[0]; $time = $ev->{StartTime}; $user = $ev->{Name}; } print "User: $user LOGON TIME: $time;";
But thus far I have been unable to port that execute over to perlSet colList = objWMI.ExecQuery("Associators of " _ & "{Win32_LogonSession.LogonId=" & objSession.LogonId & "} " +_ & "Where AssocClass=Win32_LoggedOnUser Role=Dependent" )
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: PERL WMI call
by planetscape (Chancellor) on Sep 17, 2007 at 15:42 UTC | |
|
Re: PERL WMI call
by moritz (Cardinal) on Sep 17, 2007 at 14:37 UTC | |
|
Re: PERL WMI call
by Muggins (Pilgrim) on Sep 18, 2007 at 10:27 UTC |