Software >> OS >> Windows >> API >> ADSI >> Perl >>  How to display the full name aka. account Display Name - for a particular user

Following perl script assumes that the computer running it is already a member of the domain and the session is already authenticated by domain login. eg. use Win32::OLE; use Win32::OLE qw( in ); print GetFullname("someusername","somedomain"); sub GetFullname() { my $sMyUsername = shift; my $sMyDomain = shift; my $oUser = Win32::OLE->GetObject("WinNT://" . $sMyDomain . "/" . $sMyUsername . ",user"); $sFN = $oUser->{Fullname}; return $sFN; }