Get-acl to list folder permissions...

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 14 years and 8 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
kocchB
Posts: 9
Last visit: Mon Nov 05, 2012 3:18 pm

Get-acl to list folder permissions...

Post by kocchB »

Get-acl c:Windows will get me the result below
I have a list of folders in a text file. The each folder name has a space. For example: Common Document.

Get-acl c:Common Document generate an error.

1/ How is the correct command to get the ACL of the folder.
2/ How do you write a PS code to read the txt file and list in a txt file the ACL for each folders. Remember each folder in the list has space in its name.

Thanks for your assistance.
PS: Any good book to learn Powershell ?
User avatar
kocchB
Posts: 9
Last visit: Mon Nov 05, 2012 3:18 pm

Get-acl to list folder permissions...

Post by kocchB »

Get-acl c:Windows will get me the result below
I have a list of folders in a text file. The each folder name has a space. For example: Common Document.

Get-acl c:Common Document generate an error.

1/ How is the correct command to get the ACL of the folder.
2/ How do you write a PS code to read the txt file and list in a txt file the ACL for each folders. Remember each folder in the list has space in its name.

Thanks for your assistance.
PS: Any good book to learn Powershell ?
User avatar
jhicks
Posts: 1789
Last visit: Mon Oct 19, 2015 9:21 am

Get-acl to list folder permissions...

Post by jhicks »

You can get by even with:get-content folders.txt | get-aclIs there specific ACL information you want? Do you want to save it or do something else with it?
User avatar
kocchB
Posts: 9
Last visit: Mon Nov 05, 2012 3:18 pm

Get-acl to list folder permissions...

Post by kocchB »

Hi falle,What parts of the access do you want to list? The "Access" column that get-acl outputs, by default, is a collection of access rules that have these properties (sample):AccessControlType: AllowFileSystemRights: FullControlIdentityReference: BUILTINAdministratorsInheritanceFlags: ContainerInherit, ObjectInheritIsInherited: TruePropogationFlags: NoneI am wondering if the utility 'dumpsec' from http://www.systemtools.com/somarsoft/ will do what you want?Bill

I will need to display in the output :
AccessControlType, FileSystemRights, IdentityReference
This topic is 14 years and 8 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked