Prints Windows Primary Domain Controller : NetAdmin « Win32 « Perl






Prints Windows Primary Domain Controller

  

          
#!/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() );
}

   
    
  








Related examples in the same category

1.Create a new user account
2.Listing all users
3.Get Servers