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;

-OzzyOsbourne


In reply to Re: Getting share permissions in win32 by OzzyOsbourne
in thread Getting share permissions in win32 by OzzyOsbourne

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.