I'm using ActivePerl
build #522 with Win32::NetAdmin version 0.062.
I am trying to use
Win32::NetAdmin::UsersExist() to check if user account
names input by a
user are valid ones.
It works fine
if it is a local account on the machine the script is running on,
or
if the user account
is in the same domain that I am currently logged into.
The problem is that
if I try to validate a user in a different domain, the call
to
Win32::NetAdmin::UsersExist() always returns an
error.
I am always able to
retrieve the PDC, so I don't think that's an issue. Am I
missing
something
here???
Here's the code
snippet:
#################################################################
if (!
Win32::NetAdmin::GetDomainController("",$service_domain, $PDC))
{
print "\n\tError: Cannot determine PDC for Windows domain $service_domain\n";
exit 1;
}
print "\n\n\tLooking up Primary Domain Controller (PDC)...\n";
print "\tSuccess! PDC = $PDC\n";
$node_name = $PDC;
print "\n\tError: Cannot determine PDC for Windows domain $service_domain\n";
exit 1;
}
print "\n\n\tLooking up Primary Domain Controller (PDC)...\n";
print "\tSuccess! PDC = $PDC\n";
$node_name = $PDC;
if (!
Win32::NetAdmin::UsersExist($node_name,$service_account))
{
print "\n\tError: User \"$service_domain\\$service_account\" not found on $node_name\n";
exit 1;
}
print "\n\tError: User \"$service_domain\\$service_account\" not found on $node_name\n";
exit 1;
}
#################################################################
Any help would be
greately appreciated!!
Thanks,
Steve
Steve Bourgeois
Principal Consultant
Blue Hills Technology Corporation
33 Allerton Road
Milton, MA 02186-2844
(
Phone: (617) 696-2422: Internet: [EMAIL PROTECTED]
__________________________________________________
