Solved

determining subfolder inheritance

Posted on 2011-02-23
20
617 Views
Last Modified: 2012-05-11
What is the simplest way to determine if there is any discrepancy in a sub folders acl?

Say, I want E:\UserData\TomJones folder to have an ACL containing only system, admins, and TomJones account (this being the only explicitly defined entry).

But a child folder within that structure actually has an explicitly defined ACE for the group Marketing.

How can I determine that all child folders do not follow the rules for the parent folder?
I'm thinking I'll have to perform some recursion and test each folder's security within TomJones folder, but I hope not...any suggestions
0
Comment
Question by:sirbounty
  • 9
  • 8
  • 2
  • +1
20 Comments
 
LVL 16

Expert Comment

by:uescomp
Comment Utility
right click the folder, select properties, then security tab, go into the advanced options, there should be a check box in there that has inherit child objects permissions, this might however remove all users from the folder so you would have to then resetup the users you want to have access to the folder/folders.
0
 
LVL 67

Author Comment

by:sirbounty
Comment Utility
Sorry, I forgot to add that I need a method to do this from command-line.
I don't necessarily want to remove any security, just validate that there is no discrepancy from what the parent shows...
0
 
LVL 12

Expert Comment

by:Navdeep
Comment Utility
Hi,

you can use powershell command to check that get-acl -path FolderName | FL or better

(get-acl -path x:\temp).Access

It will show you IsInherited as true if inheritance is checked otherwise false if unchecked

0
 
LVL 59

Expert Comment

by:Darius Ghassem
Comment Utility
0
 
LVL 67

Author Comment

by:sirbounty
Comment Utility
Hmm - don't have powershell on my 2k3 servers, so that's not going to work here.
I'll look into lcacls and let you know...
0
 
LVL 12

Expert Comment

by:Navdeep
Comment Utility
you can install powershell

anyways you can check the follow two article on how to use cacls

http://support.microsoft.com/kb/318754
http://www.techrepublic.com/article/use-caclsexe-to-view-and-manage-windows-acls/1050976
0
 
LVL 67

Author Comment

by:sirbounty
Comment Utility
No, sorry we can't install powershell on the 2k3 servers in our environment.
I'm familiar with cacls - just not the logic I would need to pull this off perhaps...hoping icacls will prove a bit better...
0
 
LVL 67

Author Comment

by:sirbounty
Comment Utility
I see icacls has a method to save and restore the acl, but this isn't quite what I'm after either.
Is there any simple solution that will point out that there are any files/folders beneath the parent that differ from the ACL of the parent?
0
 
LVL 59

Expert Comment

by:Darius Ghassem
Comment Utility
No there is not a simple tool.
0
 
LVL 12

Expert Comment

by:Navdeep
Comment Utility
I know that u cant install ps on ser er but u can install on any workstation xp ,win 7 will have it.log in with ur add min creds n map the server drive n use commands they r really easy
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 67

Author Comment

by:sirbounty
Comment Utility
Ok, I can perhaps ensure that this is run from a Win7/Win2k8 server, so perhaps ps will work...however I think it needs some tweaking?

Presumably this is just the access for the parent folder - how does it inform me on the differences in any child folders?

I do like the layout that this method presents though - could certainly work for what I'm trying to accomplish...(just when I'd given up on pursuing powershell - ha)

0
 
LVL 12

Accepted Solution

by:
Navdeep earned 500 total points
Comment Utility
First run this command to check if you can run ps code

Get-ExecutionPolicy
RemoteSigned

if it's something else then run the following command

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned


Now run the following command to get folder path

get-childitem P:\folderName -recurse | foreach {$_.directoryName} | Get-Unique

You can either copy from the console or redirect it to a csv file

get-childitem P:\folderName -recurse | foreach {$_.directoryName} | Get-Unique | Out-File -FilePath P:\Temp\inheritance.txt

Open the File, Add FolderName (can be anything) as header, rename the extension to .csv

Now

import-csv -path P:\temp\inheritance.csv | %{Get-Acl $_.FolderName} | FT Path, AreAccessRulesProtected -Wrap

False if for Inheritance Enabled / True for Inheritance Disabled

You can run the following command to verify on test folder or file
Get-Acl -Path C:\windows | FL Path, AreAccessRulesProtected

Check in GUI to verify

0
 
LVL 12

Expert Comment

by:Navdeep
Comment Utility
Sorry i gave you for inheritance for access rules everything remains the same except additional property

import-csv -path P:\temp\inheritance.csv | %{Get-Acl $_.FolderName} | FT Path, AccessToString -Wrap
0
 
LVL 67

Author Comment

by:sirbounty
Comment Utility
I get "cannot validate argument on parameter path" (the argument is null or empty).
0
 
LVL 12

Expert Comment

by:Navdeep
Comment Utility
Where its failing i have tested it works like charms

Can u post the error as well as the command
0
 
LVL 67

Author Comment

by:sirbounty
Comment Utility
Looks like it's my fault for skipping your instruction to add the header line.

So, this is checking the ACL on each subfolder...how do I compare all of those agains the first (parent) entry?
0
 
LVL 12

Expert Comment

by:Navdeep
Comment Utility
I have provided two codes, One check inheritance on subfolder and another one checks permissions

now if you like to compare, the output you will get as boolean true or false.

is that what you looking for?
0
 
LVL 67

Author Comment

by:sirbounty
Comment Utility
I'm looking for something that would show

C:\ParentFolder - ACL = Admins:F, Marketing:C, SYSTEM:F
  (all matches I don't care about - if any child folders inherit and have no modification on the ACL)
But if there is one that differs, I need to know it:
C:\ParentFolder\Child17 = Admins:F, Marketing:C, SYSTEM:F, Operations:C

I don't really care about the formatting, just that there is a child folder somewhere that isn't holding true to the parent's ACL.  Hope that makes sense?
0
 
LVL 12

Expert Comment

by:Navdeep
Comment Utility
Then i can suggest you a tool called dumsec. Try to use that tool and check if that helps.
0
 
LVL 67

Author Closing Comment

by:sirbounty
Comment Utility
I ended up using fileacl.
but the code has potential to help with other things.  Thanks.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Ever notice how you can't use a new drive in Windows without having Windows assigning a Disk Signature?  Ever have a signature collision problem (especially with Virtual Machines?)  This article is intended to help you understand what's going on and…
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

763 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