Solved

Remove folder access problem from parent dir -Urgent

Posted on 2013-11-27
5
741 Views
Last Modified: 2014-02-03
$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
Comment
  • 2
5 Comments
 
LVL 40

Expert Comment

by:Subsun
ID: 39690186
So are you just trying to remove the inherited permission from the folder where you copy the permissions?
0
 
LVL 5

Author Comment

by:VIVEKANANDHAN_PERIASAMY
ID: 39691301
Yes i want to remove the inherited permission apart from set of domain groups.
0
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
ID: 39701639
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

Shouldn't all users have the same email signature?

You wouldn't let your users design their own business cards, would you? So, why do you let them design their own email signatures? Think of the damage they could be doing to your brand reputation! Choose the easy way to manage set up and add email signatures for all users.

Join & Write a Comment

Learn about cloud computing and its benefits for small business owners.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now