Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
use strict; use Win32::FileSecurity qw(Get EnumerateRights); use File::Find; my $share=$ARGV[0]; my $out=$ARGV[1]; my ($name,$mask,@rights,%hash,$server,%rights2,@folders,$subfolder,$se +rvsplit,$subsplit,$right,$item); my @servers=('SERVERXX','SERVERXX','SERVERXX','SERVERXX','SERVERXX','S +ERVERXX','SERVERXX','SERVERXX','SERVERXX','SERVERXX','SERVERXX','SERV +ERXX','SERVERXX','SERVERXX','SERVERXX','SERVERXX','SERVERXX','SERVERX +X'); @servers=map ("//$_/$share",@servers); my @rightsmatch=('DELETE','READ_CONTROL','WRITE_DAC','WRITE_OWNER','SY +NCHRONIZE','STANDARD_RIGHTS_REQUIRED','STANDARD_RIGHTS_READ','STANDAR +D_RIGHTS_WRITE','STANDARD_RIGHTS_EXECUTE','STANDARD_RIGHTS_ALL','SPEC +IFIC_RIGHTS_ALL','ACCESS_SYSTEM_SECURITY','MAXIMUM_ALLOWED','GENERIC_ +READ','GENERIC_WRITE','GENERIC_EXECUTE','GENERIC_ALL','FULL','READ',' +CHANGE'); open (OUT, ">$out") or die "can't open log file!"; foreach $server( @servers ) { print "$server\n"; @folders=''; find(\&wanted, $server); foreach $subfolder (@folders){ print "\t:$subfolder\n"; next unless -e $subfolder ; if ( Get( $subfolder, \%hash ) ) { while( ($name, $mask) = each %hash ) { ($servsplit,$servsplit,$servsplit,$subsplit)=split(/\//,$subfo +lder,4); print OUT "$servsplit\t$subsplit\t$name\t"; EnumerateRights( $mask, \@rights ) ;#creates @rights, a list o +f rights for the account %rights2=(); foreach $right (@rights){ $rights2{$right} = 1; } foreach $item (@rightsmatch){ if (exists $rights2{$item}){ print OUT "$item\t"; }else{ print OUT "\'\t"; } } print OUT "\n"; } } else { print( "Error #", int( $! ), ": $!" ) ; } } } close OUT; sub wanted { if (-d){ push @folders, "$File::Find::dir/$_"; } }

In reply to Compare Directories/Permissions across all servers by OzzyOsbourne

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others chanting in the Monastery: (3)
    As of 2018-07-16 01:16 GMT
    Find Nodes?
      Voting Booth?
      It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

      Results (330 votes). Check out past polls.