Update: I realized I posted something a while back, and realized why I looked at setacl in the first place - that Win32::Perms wasn't getting the local groups associated with the share, only the groups on the domain. I tried it again, and confirmed that's still the case. I tried the rmtshare solution that was suggested, but that doesn't really work in my Active Directory environment. (rmtshare is part of the Win NT 4 Resource Kit, and was not in the Win2k Resource Kit). Anybody seen this, where it doesn't recognize local permissions?

Update 2: The same thing happens when querying two network shares, one a Win2k server and another a netapp box, but it does get the local groups if I query the box that the script is running on. Odd... I emailed bugs@roth.net, since there doesn't seem to be any sort of discussion board on their site to pose this question.


Hi, I'm writing code to manage NTFS permissions. I looked at Win32::Perms, and may use that, but also found an application, setacl, that offers functionality through an ActiveX control (OCX), which can be used from any COM-enabled language. The author includes a sample perl script with the download, from which I've excerpted code below. Are there any advantages to using that vs. Win32::Perms? I contacted the author, and he's not really developing it anymore, and my gut feeling is that it isn't as well tested as Win32::Perms. But I wanted to post this question, since there may be issues that I'm not aware of. (I'm more a unix person, so I don't know all too well how perl works as 'COM-Enabled' language, among other things).
use strict; use Win32::OLE qw(in with EVENTS); use Win32::OLE::Const; # # Start of script # # Create the SetACL object my $oSetACL = Win32::OLE->CreateObject ('SetACL.SetA +CLCtrl.1') or die "SetACL.ocx is not registered on your system! Use r +egsvr32.exe to register the control.\n"; # Load the constants from the type library my $const = Win32::OLE::Const->Load ($oSetACL) or di +e "Constants could not be loaded from the SetACL type library!\n"; # Enable event processing Win32::OLE->WithEvents ($oSetACL, \&EventHandler); # # Check arguments # my $Path = $ARGV[0] or die "Please specify the ( +file system) path to use as first parameter!\n"; my $Trustee = $ARGV[1] or die "Please specify the tr +ustee (user/group) to use as second parameter!\n"; my $Permission = $ARGV[2] or die "Please specify the per +mission to set as third parameter!\n"; ... # Set the object my $RetCode = $oSetACL->SetObject ($Path, $const->{S +E_FILE_OBJECT});

-- Burvil


In reply to Why use OCX on Win32? by bowei_99

Title:
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, details, 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, summary, 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.