in reply to Getting share permissions in win32

Depending on what you need, this may help, too (from the NT Resource Kit, GUI based):

NETWATCH.EXE: Net Watcher - Windows-based tool, shows who is connected to shared directories.

Christian Lemburg
Brainbench MVP for Perl
http://www.brainbench.com

Replies are listed 'Best First'.
Re: Re: Getting share permissions in win32
by OzzyOsbourne (Chaplain) on Mar 19, 2001 at 20:00 UTC

    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

      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.