There is a simple way to get the information about users... on to a given remote
machine if you have Administrator privileges on the remote.

use Win32::NetAdmin;

> Win32::NetAdmin::LoggedOnUsers($hostip, \%userinfo);

> The '%userinfo' hash will contain a hash of all users logged on
> to the remote machine, and the characteristics of the logon. All
> you have to do is select the "Interactive" users and you'll have
> your list. No software will have to run on the remote machine,
> so you don't have to worry about users killing your remote
> processes, or deleting the scripts.
 
--Thanks for the tip, however, I seem to be running into some issues with the 
function.  I've tried using the fully scoped name for the LoggedOnUsers function
as well as hauling it out of the package with qw(LoggedOnUsers).  I've tried
using both hostname and IP address to no avail.  When I add a die option to the
LoggedOnUsers function it gives me this error:

No such file or directory at c:\documents and settings\dskiles\desktop\headcount.pl

Here is the script:
-----------------------
#!c:/perl/bin/perl.exe

use Win32::NetAdmin;

$host = <STDIN>;

Win32::NetAdmin::LoggedOnUsers($host, \%userinfo) ||
die "$!";
------------------------

I've tried entering both the IP and hostname of the student workstation I want to 
query.  Am I making a stupid newbie mistake or something?



_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to