Today would like to share with you about a way to list down all the Folder and subfolder permission into a CSV format. This is good especially for internal or external audits.
There are two options that you can run.
- Run in the File Server (provided you have PowerShell installed)
- Run from your Computer (Map the File Server Drive, and also provided you have PowerShell installed in your computer)
The coding is as below :
# This is the file specified for the Output of CSV. Make the necessary change $Header = "Folder Path,IdentityReference,AccessControlType,IsInherited,InheritanceFlags,PropagationFlags"
$Folders = dir $RootPath -recurse | where {$_.psiscontainer -eq $true} foreach ($Folder in $Folders){ |
Note : Make changes to the Pink in colour according to your CSV file and which path you want to scan your File Server and export out the permission listing.
The output will be something like below when open with Excel :
I’m executing on my PC, that’s the reason I have the output as above.
Thank you and hope this helps.
keywords : ACL, folder permission, powershell, File Server, fileserver, Access list, access control list, permission to CSV
thanks for your post, how to export folder and sub folder and all file permission ,such as below
ReplyDeletePath FileSystemRights AccessControlType IdentityReference IsInherited InheritanceFlags PropagationFlags
K:\Testing of country code.docx Modify, Synchronize Allow Everyone TRUE None None