This is what I ended up doing as a gapstop measure. It will become more complex (using file::find), but this is the basic structure I used. Notice that it is rather close to the sample code in the docs. :)
The most difficult part of this process was actually picking the module. Some modules were so complex in that they were way beyond me, and others had such bad documentation that I sat there scratching my head on how to get them going.
This just seemed like the simplest way to get this done.
Thanks for all the suggestions!
use strict; use Win32::FileSecurity qw(Get EnumerateRights); my $share=$ARGV[0]; my $out=$ARGV[1]; my ($name,$mask,@rights,%hash,$server); my @servers=('SERVERX','SERVERX','SERVERX','SERVERX','SERVERX','SERVER +X','SERVERX','SERVERX','SERVERX','SERVERX','SERVERX','SERVERX','SERVE +RX','SERVERX','SERVERX','SERVERX','SERVERX','SERVERX','SERVERX','SERV +ERX','SERVERX','SERVERX','SERVERX','SERVERX','SERVERX'); @servers=map ("//$_/$share",@servers); open (OUT, ">$out") or die "can't open log file!"; foreach $server( @servers ) { next unless -e $server ; if ( Get( $server, \%hash ) ) { print OUT "$server\n"; print "$server\n"; while( ($name, $mask) = each %hash ) { print OUT "\t$name:\n\t\t"; EnumerateRights( $mask, \@rights ) ; print OUT join( "\n\t\t", @rights ), "\n"; } } else { print( "Error #", int( $! ), ": $!" ) ; } } close OUT;
In reply to Re: Getting share permissions in win32
by OzzyOsbourne
in thread Getting share permissions in win32
by OzzyOsbourne
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |