How to Export Folder Permissions as an Excel CSV file format and use it for comparison or any other purpose then here are the simple steps on how we can achieve it.
System administrator as part of the daily tasks they work on folder operations like copying, moving and deleting the folders, when we have to maintain the same permission of source folder or to get the ACL permission of a folder or multiple folders then we have a Powershell script to get all the ACL information.
One can also modify this simple code and get the required information, it generates the report in CSV file in minutes, here is the script.
I want to get all ACL permission of a folder located in C:\Intel.
#techdiip.com $FolderPath = dir -Directory -Path "C:\Intel" -Recurse -Force $output = @() Foreach ($oneFolder in $FolderPath) { $Acl = Get-Acl -Path $oneFolder.FullName foreach ($Access in $acl.Access) { $Properties = [ordered]@{'FolderName'=$oneFolder.FullName;'AD Group or User'=$Access.IdentityReference;'Permissions'=$Access.FileSystemRights;'Inherited'=$Access.IsInherited} $output += New-Object -TypeName PSObject -Property $Properties } } $output | Export-Csv -path "C:\temp\FolderPermissions.csv" -NoTypeInformation
Here is the output screenshot.
Thank you for reading this article, if you have any questions please let us know.
Thank you for visiting my site, for any scripts in these articles you are testing please make sure you have tested this script in our lower environment before you run in production.
Leave a Reply Cancel reply