TechTalkz.com Logo Ask the Expert

Go Back   TechTalkz.com Technology & Computer Troubleshooting Forums > Tech Support Archives > Microsoft > Microsoft Windows Powershell

Notices

ACL - Search directories where inheritance has been broken?

Microsoft Windows Powershell


Reply
 
Thread Tools Display Modes
Old 17-04-2008, 09:55 PM   #1
akcorr
Guest
 
Posts: n/a
ACL - Search directories where inheritance has been broken?

Is there a way to seach a directory tree and list out directories where
inherited permissions from the parent directories have been broken?
  Reply With Quote
Old 18-04-2008, 06:49 AM   #2
Marco Shaw [MVP]
Guest
 
Posts: n/a
Re: ACL - Search directories where inheritance has been broken?

akcorr wrote:
> Is there a way to seach a directory tree and list out directories where
> inherited permissions from the parent directories have been broken?


There must be a way, I'm just struggling with making it work.

Pseudo-code:
1. get-acl on the directory you want to compare against.
2. loop through all the directories recursively and get their ACL.
3. compare the original ACL with the current one.
4. print something out if they are different.

I'll play with it some more...

Marco

--
Microsoft MVP - Windows PowerShell
http://www.microsoft.com/mvp

PowerGadgets MVP
http://www.powergadgets.com/mvp

Blog:
http://marcoshaw.blogspot.com
  Reply With Quote
Old 18-04-2008, 07:49 AM   #3
Marco Shaw [MVP]
Guest
 
Posts: n/a
Re: ACL - Search directories where inheritance has been broken?

akcorr wrote:
> Is there a way to seach a directory tree and list out directories where
> inherited permissions from the parent directories have been broken?


Give this a try:

PSH>$acl=get-acl . #Your base ACL you want to compare against.
PSH>
get-childitem . -recurse|where-object{$_.psiscontainer}| `
foreach-object{
if($(compare-object $((get-acl $_.fullname).access) `
$($acl.access)) -ne $null){$_.fullname}
}

Start this last command from the directory you want to look through and
compare against $acl.

(Sorry for the formatting!)

--
Microsoft MVP - Windows PowerShell
http://www.microsoft.com/mvp

PowerGadgets MVP
http://www.powergadgets.com/mvp

Blog:
http://marcoshaw.blogspot.com
  Reply With Quote
Reply

Thread Tools
Display Modes



< Home - Windows Help - MS Office Help - Hardware Support >


New To Site? Need Help?

All times are GMT +5.5. The time now is 10:24 AM.


vBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO
Copyright © 2005-2010, TechTalkz.com. All Rights Reserved - Privacy Policy
Valid XHTML 1.0 Transitional