Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - ACL - Search directories where inheritance has been broken?

Reply
 
Old 04-17-2008   #1 (permalink)
akcorr


 
 

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?

My System SpecsSystem Spec
Old 04-17-2008   #2 (permalink)
Marco Shaw [MVP]


 
 

Re: ACL - Search directories where inheritance has been broken?

akcorr wrote:
Quote:

> 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
My System SpecsSystem Spec
Old 04-17-2008   #3 (permalink)
Marco Shaw [MVP]


 
 

Re: ACL - Search directories where inheritance has been broken?

akcorr wrote:
Quote:

> 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
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
F3 Search Broken Vista performance & maintenance
Listing Directories in file Search PowerShell
Vista Search Horribly Broken?!?! Vista General
Vista Search Index broken Vista General
Broken Start Search Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46