Mahajan Alok SPEL-TIT <> wrote:
: Can some one help me in getting the user full name instead of
: user id which i'm getting by using the following script.?
: This script is being used in an environment where all the users
: are one domain users having different and unique id and not the
: administrators
You can't get blood from a stone. From the docs:
<Win32::NetAdmin>
LoggedOnUsers(server, userRef)
Gets an array or hash with the users logged on at the
specified computer. If userRef is a hash reference, the value
is a [semicolon] separated string of username, logon domain and
logon server.
</Win32::NetAdmin>
Since it is not returning full names. You cannot get them from
here. Unless someone happened to use their full name as their user
name. Didn't you dump the hash to see what was in it?
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper 'Dumper';
use Win32;
use Win32::NetAdmin qw(LoggedOnUsers);
print "Enter machine name: ";
chomp( my $machine = <STDIN> );
LoggedOnUsers( $machine, \my %users );
die Dumper \%users;
__END__
HTH,
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs