use Win32::Lanman; $server = "$ARGV[0]"; if(!Win32::Lanman::NetFileEnum($server, '', '', \@infos)) { print "Sorry, something went wrong; error: "; # get the error code print Win32::Lanman::GetLastError(); exit 1; } foreach (@infos){ if(($${_}{permissions} == "1") || ($${_}{permissions} == "9")){$ac +cess = "Read";} elsif($${_}{permissions} == "35"){$access = "Read Write";} else{$access = "Unknown";} print "[" . $${_}{id} . "] " . $${_}{pathname} . "\n\tUser:\t" . $ +${_}{username} . "\n\tLocks:\t" . $${_}{num_locks} . "\n\tAccess:\t" +. $access . "\n"; }
In reply to perl version of runas by boat73
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |