blackadder has asked for the wisdom of the Perl Monks concerning the following question:
Many Thanks and "A little example can go a long way"use strict; use Win32::NetResource; use Win32::AdminMisc; use Win32::NetAdmin; use Win32::Perms; my $drive = shift @ARGV; my $srv; my $path; my $perms; if (Win32::NetResource::GetUNCName( $path,$drive)) { $path =~ /^\\\\(\w+)/; $srv = $&; print "\nServer " . $srv . "\n"; } $perms = new Win32::Perms($path) || die "\n$^E\n"; print "\nPath: " . $perms->Path() . "\n"; my $intgr = $perms->Get(\ my @perms); foreach my $permy (@perms) { while (my ($field, $data) = each %{$permy}) { next if $field !~ /account/i; if (Win32::NetAdmin::UsersExist('',$data)) { print "This '$data' is a user account\n"; } else { print "This '$data' is a group account\n"; } } print "\n\n"; }
|
|---|