programming-examples/perl/Win32/Prints Windows Primary Domain Controller.pl

15 lines
290 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
#!/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() );
}