Try using Win32::Lanman::NetWkstaUserEnum();

NetWkstaUserEnum($server, \@info)
        Lists information about all users currently logged on to the
workstation. 

NetWkstaUserEnum($server, \@info)

##  EXAMPLE  #####################################################

Lists information about all users currently logged on \\testserver. 
 if(!Win32::Lanman::NetWkstaUserEnum("\\\\testserver", \@info)){
        print "Sorry, something went wrong; error: ";
        # get the error code
        print Win32::Lanman::GetLastError();
        exit 1;
 }

 foreach $user (@info){
        @keys = keys %$user;
        foreach $key(@keys){
                print "$key=#${$user}{$key}#\n";
        }
 }

##  END EXAMPLE  ################################################
-----Original Message-----
From: Charles McIntyre [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 07, 2002 3:23 PM
To: [EMAIL PROTECTED]
Subject: logged on user


I'm trying to write a script that will return 1 if a user is logged on to a 
Win2000 workstation.  I don't need to know their name, just if someone is 
logged on or not.  I've tried using Win32::NetAdmin::LoggedOnUsers, but it 
doesn't give any result.

        Win32::NetAdmin::LoggedOnUsers($computer, \%result);
        $key = keys %result;
        print "$computer: $key $result{$key}\n";

Is my code wack, or am I missing something?  Are there some security issues 
with RestrictAnonymous (the workstations are set at 0), or other registry 
security settings?

Any other modules, clues?

Thanks!!!

Charles

___________________________

Charles McIntyre
PC/UNIX Support Engineer
Instructional Computing, UCSC
ph: 831/459-5746

got a question? see http://ic.ucsc.edu/help

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


--------------------------------------------------------------------------------
This email may contain confidential and privileged 
material for the sole use of the intended recipient. 
If you are not the intended recipient, please contact 
the sender and delete all copies.
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to