Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: userinfo on NT

by the_slycer (Chaplain)
on Jul 12, 2001 at 18:26 UTC ( #96041=note: print w/replies, xml ) Need Help??


in reply to userinfo on NT

Update Ok, This is better now. Here's how to use Win32::Lanman to do this.
use Win32::Lanman; my $domain="DOMAINNAME"; my $pdc; my $username; my %info; Win32::Lanman::NetGetDCName('',$my_domain,\$pdc); Win32::Lanman::NetUserGetInfo($pdc, $username, \%info); print "$_ == $info{$_}\n" foreach keys %info;
This is of couse assuming that you are after what you asked (ie full name of $env{username} ) vs the code you posted (ie enumerating all users in the domain)

Replies are listed 'Best First'.
Re: Re: userinfo on NT
by physi (Friar) on Jul 12, 2001 at 19:30 UTC
    Looks like this will do exactly what I need (I really need only the full name, not all the users from the domain).

    BUT ...

    where can I get Win32::Lanman ??
    I found the pod on the web, but no source :(
    Please gimme a hint :)
    Thanks.
    ----------------------------------- --the good, the bad and the physi-- -----------------------------------
    Update: found it under: http://sunsite.compapp.dcu.ie/pub/perl/modules/by-module/Win32/JHELBERG/

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://96041]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (2)
As of 2023-01-29 06:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?