This project is read-only.

Toolkit Extension: Set-Rights($Path) : Grants "Full Control" rights to User Group "Users" on $Path

Topics: Archive - Toolkit Extensions
Nov 20, 2013 at 11:50 PM
# Set Users Security Group to have "Full Control" Rights to a folder.
    Function global:Set-Rights()
        # Define folder for user rights assignment
            $acl = Get-Acl $RightsFolder
        # Define ACL rule to apply to the folder
            $rule = New-Object System.Security.AccessControl.FileSystemAccessRule("Users","FullControl", "ContainerInherit, ObjectInherit", "None", "Allow")
        # Apply the rule to the folder
            Set-Acl $RightsFolder $acl
            Write-Log "Granting Users Full Control Access to folder $RightsFolder"
Nov 21, 2013 at 5:13 PM
Great job on providing all the extensions :)

One thing you might consider doing is adding a few new parameters. I've picked out a few common ones, based on the FileSystemAccessRule constructor:
    [string] $Path,
    [string] $User,
    [ValidateSet("Delete","Modify", "FullControl", "Read", "Write")] 
    [string] $FileSystemRights = "FullControl",
    [ValidateSet("ContainerInherit","None", "ObjectInherit", "ContainerInherit, ObjectInherit")] 
    [string] $InheritanceFlags = "ContainerInherit, ObjectInherit",
    [ValidateSet("InheritOnly","None", "NoPropagateInherit")] 
    [string] $PropagationFlags = "None",
    [ValidateSet("Allow", "Deny")] 
    [string] $AccessControlType = "Allow"
Hope this helps, Dan