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
Solved

determining subfolder inheritance

Posted on 2011-02-23
20
620 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
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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

A quick step-by-step overview of installing and configuring Carbonite Server Backup.
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
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). …
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…

860 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