Hi All
I have an requirement to set NTFS permissions using Powershell Script. Came with below script to have the permission set:
$pathItem = "C:\TEST"
$objACL = Get-ACL $pathItem
$colRights = [System.Security.AccessControl.FileSystemRights]"FullControl"
$InheritanceFlag = [System.Security.AccessControl.InheritanceFlags]::None
$PropagationFlag = [System.Security.AccessControl.PropagationFlags]::None
$objType =[System.Security.AccessControl.AccessControlType]::Allow
$objACERule = New-Object System.Security.AccessControl.FileSystemAccessRule("NT AUTHORITY\Authenticated Users","Modify,Synchronize", $InheritanceFlag, $PropagationFlag, $objType)
$objACL.AddAccessRule($objACERule)
Set-ACL $pathItem $objACLThe above script help me to set the permission Apply to : This folder only. But i want to set the permission Apply to: Subfolders and files only.
My current script does the below:
My requirement is:
Please help how can i achieve this.
Thank you
Regards Ram