• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1214
  • Last Modified:

Remove folder access problem from parent dir -Urgent

$acl= get-acl F:\correct # correct folder permission. 
$files= get-childItem  F:\new\sub 1\sub2\sub 3|set-acl -aclobject $acl 

Open in new window

The code works only if unwanted permission exist only in Sub3 .I need exact same user permission as like  F:\correct for  F:\new\sub 1\sub2\sub . But if any un-needed permission have access to it previous folder,or parent folder, the un-wanted permissions doesn't get removed.

So,kindly help me in fixing this issue.

I need a sample help scripts where it check only required users & their corresponding persmission should exist .If it's finds any un wanted permission then it go to previous level folder and have to remove those permission.
And if the previous sub folder inherit the unwanted permission from parent folder then it should remove those from the parent folder as well.
0
VIVEKANANDHAN_PERIASAMY
Asked:
VIVEKANANDHAN_PERIASAMY
  • 2
1 Solution
 
SubsunCommented:
So are you just trying to remove the inherited permission from the folder where you copy the permissions?
0
 
VIVEKANANDHAN_PERIASAMYAuthor Commented:
Yes i want to remove the inherited permission apart from set of domain groups.
0
 
SubsunCommented:
Sorry I missed this alert.. Try..

$acl= get-acl F:\correct # correct folder permission. 
$acl.SetAccessRuleProtection(1,0)
$files= get-childItem  F:\new\sub 1\sub2\sub 3|set-acl -aclobject $acl 

Open in new window

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now