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

I feel like a taker asking this question, as I fear I have not posted even the smallest answer over the last few weeks, but:

Is there a way to get the Full Name from User Manager in NT? It seems that you can get comments, etc. via win32::NetAdmin, but not the fullName.

Thanks again.

-OzzyOsbourne

  • Comment on Win32:Getting the Full Name from User Manager

Replies are listed 'Best First'.
Re: Win32:Getting the Full Name from User Manager
by the_slycer (Chaplain) on Nov 09, 2000 at 20:40 UTC
    For a basic solution:
    use strict; use Win32; use Win32::Lanman; my %info; my $server="pdc"; my $user="username"; if (Win32::Lanman::NetUserGetInfo($server, $user, \%info)){ print "$info{name} is $info{full_name}"; } else {print Win32::Lanman::GetLastError()}
    I'm sure you can clean up the error messages a bit (something with getlasterror? can't quite remember the syntax for that though). But this should do the trick as is..

    UPDATE: Found the easy syntax for error messages and changed the above

      I can't find a win32::Lanman on Cpan. Do you mean WIN32API::NET?

      -OzzyOsbourne

        No, I believe it's just called lanman, I think that I got it from jenda's pages.. but I can't get there right now. Not sure if maybe the activestate ppm rep has it? Try http://jenda.mccann.cz/ and see if you can hit it.

        UPDATE: found the working link here and as much as I agree with tye's rant below, this is a really good module, why it's not on cpan is beyond me.

        Another update: This IS on cpan, just didn't see it the first glance I took, check the win32 directory and look for lanman.1.0.8.1.zip - no win32 in front :-)