troubleshooting Question

Need to Change ACL (Permissions )and disable in heritance for subfolders

Avatar of SAM IT
SAM IT asked on
Scripting LanguagesPowershell
39 Comments1 Solution265 ViewsLast Modified:
Below script create sub folders and I Need to  disable inheritance for Foldera and folderb and Change the permissions from particular security Group from Modify to Read For other folders no changes needed

For Foldera and Folderb ACL should be Read Permission
and for rest of the folders Modify Permission

$root = "C:\Users\a.narasimha.s\Desktop\foldertest1"

ForEach ($dir in (Get-ChildItem -Path "$root\*\" | ?{$_.PSIsContainer} | Select -Expand Name)){



  New-Item -Path "$dir\folder1" -ItemType Directory | Out-Null
  New-Item -Path "$dir\folder2" -ItemType Directory | Out-Null
  New-Item -Path "$dir\1" -ItemType Directory | Out-Null
  New-Item -Path "$dir\2" -ItemType Directory | Out-Null

 }
ASKER CERTIFIED SOLUTION
Chris Dent
PowerShell Developer
Join our community to see this answer!
Unlock 1 Answer and 39 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 39 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros