get-acl for all folders in a directory

is there anyway to use get-acl to get the ACL for all sub folders in a directory. That is as far down the structure as I want it to report, not every file and other folders in the sub folders, but just one level - written to excel CSV? It would be great if it could also include the size of the sub folders as well in MB.
LVL 3
pma111Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

 
LBTechSolOperations DirectorCommented:
you can complete via powershell or the easy way: CJWDEV

Here
0
 
pma111Author Commented:
thanks for the pointer on the tool, looks good. However I set a report running by selecting the share I am after and its gone straight into reporting on all the sub folders as well, I only really want the root folders in the path I specify as per the question, not as deep as the folder structure goes in each folder. the volume of data for approx 2000 home drives is going to be enourmous with all the sub folders within each
0
 
pma111Author Commented:
get-childitem \\server\share -recurse | Where-Object{($_.psiscontainer)} | Get-Acl | export-csv permissions.csv
0
WEBINAR: 10 Easy Ways to Lose a Password

Join us on June 27th at 8 am PDT to learn about the methods that hackers use to lift real, working credentials from even the most security-savvy employees. We'll cover the importance of multi-factor authentication and how these solutions can better protect your business!

 
pma111Author Commented:
that command works like a charm
0
 
MacleanSystem EngineerCommented:
Here's an alternative that might help as well. But use what is easiest I'd say :)

icacls
0

Experts Exchange Solution brought to you by ConnectWise

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
 
pma111Author Commented:
What would syntax be for icacls for all root level directories only on a share?
0
 
MacleanSystem EngineerCommented:
Gets a bit comprehensive at times. I would find out what my share root is, run the icacls c:\sharelocation\* /save aclfile /t and review the output.
You can then use the article to cross reference permissions and change it for root only, save it as a new file, then do a restore using new file. (Keep
However before doing any such thing make sure you got both backups, and the original aclfile saved somewhere so you can restore original permissions or files from either method in case something got its knickers in a twist.
I have not used the Powershell one myself, however if more intuitive I would use that. Whichever one is easiest to use generally gets my "thumbs up". And easiest depends on the eye of the beholder.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.