You are setting $computer to "//rwaldock". You rpobably want two
backslashes in front of the name instead of two forward slashes.

Your code is set to strip out leading backslashes, but you don't have
any in your computer name.

HTH,

--Chuck


--- [EMAIL PROTECTED] wrote:
> Hi,
> 
> I have today seen reference to and have installed the lanman module.
> 
> I cant find any documentation for it.
> 
> I would like to use it to find the logged in users to our development
> server at http://xxx.xxx.xxx
> 
> I am using NT and are connected to it via our own intranet.
> 
> I have tried the following code but it gives an error 123
> 
> # NetWkstaUserEnum($server, \@info)
> # Lists information about all users currently logged on \\$computer.
> # Specify target machine as argument (with or without preceding \\)
> 
> #==============================================
> # SPECIFY TARGET COMPUTER AS FIRST ARGUMENT;
> #==============================================
> use Win32::Lanman ;
> 
> #$computer = "$ARGV[0]" ;
> $computer = '//rwaldock' ;
> 
> print "\n" ;
> 
> $computer = substr($computer,2,) if (substr($computer,0,2) eq "\\\\")
> ;
> print "------------[Listing logged in users on
> $computer]------------\n" ;
> 
> if(!Win32::Lanman::NetWkstaUserEnum("\\\\$computer", \@info)) {
>      print "Sorry, something went wrong; error: ";
>      # get the error code
>      print Win32::Lanman::GetLastError();
>      print " : $^E\n" ;
>      exit 1;
>      }
> 
> foreach $user (@info) { @keys = keys %$user;
>         foreach $key (@keys)
>         {
>                ${$user}{$key} =~ s/^a-//i ;
>                     print "$key=[${$user}{$key}]\t";
>                     $mail_alias = ${$user}{username} ;
>         }
> 
> print "\n\n" ;
> }
> 
> I am very new to this module and have almost no idea what it does or
> how it does it and would appreciate any help.
> 
> I have full access to the web server via pc-anywhere and so I can do
> anything to it.
> 
> I am using to try to find out what students are logged in to it and
> using Frontpage.
> 
> Thanks
>   Roy
> 
> _______________________________________________
> Perl-Win32-Admin mailing list
> [EMAIL PROTECTED]
> http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin

Reply via email to