List all Permissions in Share Recursively
Get-childitem \\network\share\ -recurse | Where-Object{$_.psiscontainer} |
Get-Acl | ForEach-Object {
$path = $_.Path
$_.Access | ForEach-Object {
New-Object PSObject -Property @{
Folder = $path.Replace("Microsoft.PowerShell.Core\FileSystem::","")
Access = $_.FileSystemRights
Control = $_.AccessControlType
User = $_.IdentityReference
Inheritance = $_.IsInherited
}
}
} | select-object -Property User, Access, Folder | export-csv output.csv -force