PowerShell – Check Permissions on files and folders

While looking up some PowerShell scripts, I came across a neat command to recursively look through a folder and report on security and permissions for objects in the folder and subfolders.

Get-ChildItem C:\Scripts -recurse | ForEach-Object {Get-Acl $_.FullName} | Export-CSV C:\filename.csv

In Windows Server 2003, PowerShell is not automatically installed. You can also use a simple command – CACLS – to perform the same function.

cacls [TopFolder] /t > C:\filename.txt

This will dump the security information for TopFolder and all subfolders into the filename.txt file.

Some great resources for PowerShell scripting can be found from these links.

Leave a Reply

Your email address will not be published. Required fields are marked *

Solve the Equation to continue * Time limit is exhausted. Please reload CAPTCHA.