script to read a txt of folders and export ACL to a file.

I have a txt file with a list of folder with path.  For example, k:\data\sales.

How do I write a script to read this txt file and export the ACL of each subfolder to a CSV file?

Please advise.

Thanks.
nav2567Asked:
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.

SubsunCommented:
Try..
$inputFile = "C:\input.txt"
Filter Rights {
	Switch ($_) {
	"268435456"   {"FullControl"}
	"-536805376"  {"Modify, Synchronize"}
	"-1610612736" {"ReadAndExecute, Synchronize"}
	Default {$_}
	}
}
GC $inputFile | % {
Dir $_ -recurse | ? {$_.psiscontainer} | % {
	$Folder = $_.Fullname
	Get-acl $Folder | % { $_.Access} | 
	Select @{N="Folder";E={$Folder}},IdentityReference,@{N="FileSystemRights";E={$_.FileSystemRights | Rights}},`
	AccessControlType,IsInherited,InheritanceFlags,PropagationFlags
	}
}| Export-Csv "C:\temp\Permissions.csv" -NTI

Open in new window

0

Experts Exchange Solution brought to you by

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
SubsunCommented:
@nav2567, May I know the reason for B grade?

Please see the EE guidelines on grading..
http://support.experts-exchange.com/customer/portal/articles/481419
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.