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.
- Microsoft PowerShell Technet reference – http://technet.microsoft.com/en-us/library/ee692944.aspx
- 10 Cool things you can do with PowerShell – http://blogs.techrepublic.com.com/10things/?p=302
- Hey, Scripting Guy blog – http://blogs.technet.com/b/heyscriptingguy/
- The Official Scripting Guys Forum – http://social.technet.microsoft.com/Forums/en-US/ITCG/threads