in reply to Win32:Getting the Full Name from User Manager

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

Replies are listed 'Best First'.
RE: Re: Win32:Getting the Full Name from User Manager
by OzzyOsbourne (Chaplain) on Nov 09, 2000 at 21:29 UTC

    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 :-)

        <RANT>...which is why it really pisses me off that these modules are not on CPAN. People can't find them. You don't have the dozens of servers so if one server goes down, you're stuck. Great resources like http://search.cpan.org don't index them. And on and on...</RANT>

        So I try to avoid them. I think there are several modules that can get your the full name for a user. Win32API::Net is on CPAN so I used search.cpan.org to look up the docs and it should work for you.

                - tye (but my friends call me "Tye")