I would like to modify the following Powershell script to add an AD Security Group to a shared folder, but I'd like to also like to set the Inheritance and Propagation flags so that the security group is applied to "This Folder, Subfolder & Files":
$acl = Get-Acl \\OFS1\Data\Accounts
$AccessRule = New-Object System.Security.AccessControl.FileSystemAccessRule("OREP\Custom-ADSecurityGroup","FullControl","Allow")
$acl | Set-Acl \\OFS1\Data\Accounts
I have seen various references to setting the Propagation=none and Inheritance=Container|Object and that it might be represented as so:
InheritanceFlags.ContainerInherit | InheritanceFlags.ObjectInherit
I have no idea how to incorporate this into the script above...