Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Win32::NetAdmin::LoggedOnUsers question

Status
Not open for further replies.

rickgerdes

IS-IT--Management
Feb 11, 2003
44
US
Hello folks, this one SHOULD be simple, but I'm being dense:

The code:
use Win32::NetAdmin;
my @lou;
Win32::NetAdmin::LoggedOnUsers('',@lou);
print @lou;

The result:
Usage: Win32::NetAdmin::LoggedOnUsers(server, $userRef)

The question:
What am I doing wrong? Other than working in Win32...
I want to query a box, and get the list of logged in users, specifically, I just want a COUNT of logged in users.

Thanks in advance!
 
The only description the documentation gives on how to use this particular function is:

LoggedOnUsers(server, userRef)


The thing the documentation does not make clear is that "userRef" is a reference to an array or a hash, so you have to use reference notation to get the proper results.

Here is the code that will give you a count of the users that are logged on.

use Win32::NetAdmin;
Win32::NetAdmin::LoggedOnUsers('',\@lou);
$count = @lou;
print $count;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top