> -----Original Message-----
> From: David Samuelsson (PAC) [mailto:[EMAIL PROTECTED]]
> Subject: get full name of $user in NT?
> 
> 
> Is there anyway off getting the full name from an remote 
> user? that is, i know the persons log on sign, say "ROMI"
> 
> full name is "Robert Mitchum" accordin to NT. Is there any 
> Perl code , that you know off? i have checked the 
> Win32::AdminMisc functions, and that seems to return, nothing 
> or numbers =/ when i have tried it.
> //Dave

I don't know if there's a better/faster/easier way to do this, but this is
one way to accomplish what you want:

use warnings;
use strict;
use Win32::NetAdmin qw(GetUsers GetDomainController);
my %UserHash;
my $Domain = "yourdomain";
my $UserID = "ROMI";
GetDomainController("","$Domain", my $Server);
GetUsers($Server, 0, \%UserHash) or die "GetUsers() failed: $^E";
foreach my $key(keys %UserHash) {
  if (lc($key) eq lc($UserID)) {
    print "$key is: $UserHash{$key}\n";
  }
}
__END__

Should return:
ROMI is: Robert Mitchum

Hope this helps...
Jason


CONFIDENTIALITY NOTICE:

************************************************************************

The information contained in this ELECTRONIC MAIL transmission
is confidential.  It may also be privileged work product or proprietary
information. This information is intended for the exclusive use of the
addressee(s).  If you are not the intended recipient, you are hereby
notified that any use, disclosure, dissemination, distribution [other
than to the addressee(s)], copying or taking of any action because
of this information is strictly prohibited.

************************************************************************

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to