in reply to Re: Getting share permissions in win32
in thread Getting share permissions in win32

The real goal is to audit permissions across 40 file and print servers. Given the directory sizes and complexities, I really don't want to do it manually. I will if I have to, but I don't wanna.

-OzzyOsbourne

  • Comment on Re: Re: Getting share permissions in win32

Replies are listed 'Best First'.
Re: Re: Re: Getting share permissions in win32
by idnopheq (Chaplain) on Mar 19, 2001 at 21:25 UTC
    Try a modification of the below with File::Find (I think it will do UNC paths ... anyone?) or DosGlob. You could foreach ( @ARGV ) to parse through specific shares. Win32::NetResource has a discovery capability (not for hidden shares, though).
    #!/usr/bin/perl -w use strict; use Win32::Perms; use vars qw ( @List @Mask ); my $Dir = new Win32::Perms( $ARGV[0] ); $Dir->Dump( \@List ); foreach my $shareRef ( @List ) { print "\n" , $shareRef->{'Domain'} , '/' , $shareRef->{'Account'} +, "\n\n"; Win32::Perms::DecodeMask ( $shareRef, \@Mask ); foreach ( @Mask ) { print "\t" , $_ , "\n"; } }
    BTW, the URL to Win32::Perms is:
    http://www.roth.net/perl/perms/

    Dave's main page does seem like a wonderful rendition of a cow in a snowstorm.