You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
414 B
Perl

#!/usr/bin/perl -w
use Win32::NetAdmin;
$status = Win32::NetAdmin::GetServers( '', '',
SV_TYPE_ALL,
\%all_systems );
if ($status) {
@keys = keys( %all_systems );
@sorted = sort( @keys );
foreach $key (@sorted) {
print "$key $all_systems{$key}\n";
}
} else {
print_error();
}
sub print_error {
print Win32::FormatMessage( Win32::GetLastError() );
}