- Open the Powershell ISE → Create a new script using the following code → Specify the path to the folder of interest and where the result must be exported:
$FolderPath = dir -Directory -Path "\\fs1\Shared" -Recurse -Force
$Report = @()
Foreach ($Folder in $FolderPath) {
$Acl = Get-Acl -Path $Folder.FullName
foreach ($Access in $acl.Access)
{
$Properties = [ordered]@{'FolderName'=$Folder.FullName;'AD
Group or
User'=$Access.IdentityReference;'Permissions'=$Access.FileSystemRights;'Inherited'=$Access.IsInherited}
$Report += New-Object -TypeName PSObject -Property $Properties
}
}
$Report | Export-Csv -path "C:\data\FolderPermissions.csv"
- Run the script.
- Open the file produced by the script in MS Excel.
- Run Netwrix Auditor → Navigate to “Reports” → “File Server” → ”File Server - State-in-Time” → Choose “Folder Permissions” → Click “View”.
- To save the report, click the "Export" button → Choose the preferred format, e.g. Excel → “Save as” → Choose a location to save it.