Solved

Remove folder access problem from parent dir -Urgent

Posted on 2013-11-27
5
899 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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Utilizing an array to gracefully append to a list of EmailAddresses
Windows 10 came with  a lot of built in applications, Some organisations leave them there, some will control them using GPO's. This Article is useful for those who do not want to have any applications in their image (example:me).
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

820 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