Wayne Viljoen
asked on
Powershell Script to Add AD Security Group to Shared Folder with Inheritance/Propogation set to "This Folder, Subfolders & Files"
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.AccessCont rol.FileSy stemAccess Rule("OREP \Custom-AD SecurityGr oup","Full Control"," Allow")
$acl.SetAccessRule($Access Rule)
$acl | Set-Acl \\OFS1\Data\Accounts
I have seen various references to setting the Propagation=none and Inheritance=Container|Obje ct and that it might be represented as so:
InheritanceFlags.Container Inherit | InheritanceFlags.ObjectInh erit
PropagationFlags.None
I have no idea how to incorporate this into the script above...
$acl = Get-Acl \\OFS1\Data\Accounts
$AccessRule = New-Object System.Security.AccessCont
$acl.SetAccessRule($Access
$acl | Set-Acl \\OFS1\Data\Accounts
I have seen various references to setting the Propagation=none and Inheritance=Container|Obje
InheritanceFlags.Container
PropagationFlags.None
I have no idea how to incorporate this into the script above...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER