----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, May 12, 2005 9:06 PM
Subject: win32::Lanman Error
> Hello,
>
> I have been silent listener of this list and have received great help. I
> have problem and its not being addressed even on net properly so my last
> hope is this mailing list.
>
> I have been using Win32::Lanman and it was working fine till 3 days
> before.
Something must have changed. Do you know what it was ?
>But suddenly it has started throwing the error. Also it takes
> 3-4 hours to retrieve the users(name, full name and comments) data. The
> script I use is very simple one and the error result is provided at the
> end.
>
> Platform: Windows 2000 Professional
> Perl Version: perl -v gives : This is perl, v5.6.1 built for
> MSWin32-x86-multi-thread
> Module Win32:Lanman 1.0.10 (as in PPM)
>
> Perl Script:
>
> #!perl
> use warnings;
> use Win32::Lanman;
> my $datafile="c:\\ntaccounts\\domain.acc";
> open (ACC,">$datafile") or logoff("Unable to open data file $datafile");
> unless ($domain = Win32::DomainName){die "Unable to obtain the domain
> name";}
> print "domain=$domain\n";
> unless (Win32::Lanman::NetGetDCName("", "$domain",\$PDC)){die "Unable to
> obtain the domain controller name";}
> print "PDC=$PDC\n";
> unless (Win32::Lanman::NetUserEnum("$PDC",FILTER_NORMAL_ACCOUNT,
> [EMAIL PROTECTED])){die "Unable to obtain users from $PDC";}
> print "Get users\n";
> foreach $user (@userdata)
> {
>
> print "${$user}{'name'}\n";
> print "${$user}{'comment'}\n";
> print "${$user}{'usr_comment'}\n";
> print "${$user}{'full_name'}\n";
> print ACC
> "${$user}{'name'}|${$user}{'full_name'}|${$user}{'comment'}\n";
> }
>
> Result:
> domain="domainname" (desired name)
> PDC="pdc name" (desired name)
> Unable to obtain users from PDC at testpdc.pl line 10.
>
>
Check the Win32::Lanman docs and see if there's any additional information
provided when NetUserEnum() fails. Maybe there's a useful message in $! or
$@ or Win32::FormatMessage(Win32::GetLastError()).
Cheers,
Rob
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs