#The following sample enumerates all information about all sessions and open files on server $server. use Win32::Lanman; $server=shift ARGV; if ( $server eq "" ) { print "Affiche toutes les infos sur les fichiers ouverts d'un serveur\n"; print "Arguments : [Serveur [string_a_rechercher]]\n\n"; } $string=shift ARGV; if ( $string eq "" ) { $string=".*"; } if(!Win32::Lanman::NetFileEnum("$server", '', '', \@infos)) { print "Sorry, something went wrong; error: "; # get the error code print Win32::Lanman::GetLastError(); exit 1; } foreach $info (@infos) { @keys = keys(%$info); if ( ${$info}{pathname}=~/$string/ ) { foreach $key(@keys) { print "$key: ${$info}{$key}\n"; } print "\n"; } }