http://www.perlmonks.org?node_id=96032

physi has asked for the wisdom of the Perl Monks concerning the following question:

Brothers,
I'm trying to get the full name of the current user on NT. Normaly I can use  $<, $> from that kind of stuff. But this does not work on NT. So I can use  $ENV{USERNAME} instead. This gives me the logon name. In the Usermanager there is a field where the whole Username is specified. I need to access this Information. I tried out Win32::NetAdmin but this shows me only the names of my local machine. I'm currently working in a big department, so there are many different Recourcedomains and one Masterdomain. The Accounts are on the masterdomain. So what can I do to get the Information I need? When I use this:
use Win32::NetAdmin qw(GetUser); GetUser('',undef,\%hash);
I get a hash filled with the users of the local machine.

So I thought that:

use Win32::NetAdmin qw(GetUser); GetUser('masterdomainservername',undef,\%hash);
... should give me all the users in the masterdomain. But it doesn't. I get an empty hash. Do I need admin privileges to do that? Or what can I do to get the Infomation I need without having admin-privileges ?

Any help is welcome :-)

Cheers,

----------------------------------- --the good, the bad and the physi-- -----------------------------------