15 lines
290 B
Perl
15 lines
290 B
Perl
#!/usr/bin/perl -w
|
|
|
|
use Win32::NetAdmin;
|
|
|
|
$status = Win32::NetAdmin::GetDomainController('', '', $pdc );
|
|
|
|
if ($status) {
|
|
print "Primary Domain Controller is: $pdc\n";
|
|
} else {
|
|
print_error();
|
|
}
|
|
|
|
sub print_error {
|
|
print Win32::FormatMessage( Win32::GetLastError() );
|
|
} |