I have been told by Microsoft that access to the DACL of a printer object
(not share) is only available via API (see
http://support.microsoft.com/default.aspx?scid=KB;en-us;316440&;)
UpdatePermissionsOfPrinter

Microsoft provides downloadable code on this page for a VBA program that has
samples these functions.

I have tried Dave Roth's PERMS module, but the code below reports the
permissions on the "share" not the printer object.

Can anyone either provide some code to change the permissions of a printer
object on a remote server? Is this the way PERMS was intended to work? 

my $DACL = new Win32::Perms("printer:\\\\server\\printername") 
  || die "Error getting Perms"; 
my @List;
$DACL->Dump (\@List);
$DACL->Dump; # exit;

my $i=0;
my (@Mask, @Types, @Flags, @FriendlyMask);

foreach my $item (@List)
{
        print "$i\n";
        Win32::Perms::DecodeMask( $item, \@Mask, \@FriendlyMask);
        Win32::Perms::DecodeType( $item, \@Types );
        Win32::Perms::DecodeFlag( $item, \@Flags );
        print "\nMask:@FriendlyMask\nType:@Types\nFlags:@Flags\n\n";
        foreach my $key (sort keys %{$item})
        {
                print "$key: ${$item}{$key}\n";
        }
        print "\n";
        $i++;
}

Howard A. Bullock
Global IT Infrastructure
717-810-3584


_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to