Solved

determining subfolder inheritance

Posted on 2011-02-23
20
622 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 8
  • 2
  • +1
20 Comments
 
LVL 16

Expert Comment

by:uescomp
ID: 34964019
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
ID: 34964106
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
ID: 34964587
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
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 
LVL 59

Expert Comment

by:Darius Ghassem
ID: 34964600
0
 
LVL 67

Author Comment

by:sirbounty
ID: 34964830
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
ID: 34964923
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
ID: 34964957
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
ID: 34970203
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
ID: 34970242
No there is not a simple tool.
0
 
LVL 12

Expert Comment

by:Navdeep
ID: 34970271
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
 
LVL 67

Author Comment

by:sirbounty
ID: 34982574
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
ID: 34983546
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
ID: 34983571
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
ID: 34988997
I get "cannot validate argument on parameter path" (the argument is null or empty).
0
 
LVL 12

Expert Comment

by:Navdeep
ID: 34989268
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
ID: 35007445
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
ID: 35009315
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
ID: 35009555
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
ID: 35009922
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
ID: 35087422
I ended up using fileacl.
but the code has potential to help with other things.  Thanks.
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

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…
Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
This tutorial will show how to push an installation of Backup Exec to an additional server in both 2012 and 2014 versions of the software. Click on the Backup Exec button in the upper left corner. From here, select Installation and Licensing, then I…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

732 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