Hello group,

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

However, this is a part of the script which is being used in a full script .

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
use Win32;
use Win32::NetAdmin qw(LoggedOnUsers);

print "Enter machine name: ";
chop ($Input = <STDIN>);

my $UseR = &USER($Input);

sub USER {
        my $MACHINE = $_[0];
        my @USERS;
        my @TEMPUS;
        my %hash;
        my $group;
        LoggedOnUsers($MACHINE, \%hash);
        if (defined %hash) {
                        foreach $key (keys %hash) {
                        if ($hash{$key} !~ /^install/i) {
                        $hash{$key} =~ s/\;.*//ig;
                        push(@USERS,$hash{$key}) ;
                }
        }
    }
print "All users are @USERS and number is $#USERS\n";
return ($USERS[$#USERS]);
}

print "Logged onuser is $UseR\n";
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Thanks in advance,

Alok Mahajan

_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to