If you need to report out file and folder permissions of a file share, see the below PowerShell.
First map the the share to a drive if it isnt already. In my case X: drive.
Why didn’t I do this on the server hosting the files? UAC gets in the way and is a pain the bum.
$FolderPath = dir -Directory -Path "x:\" -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:\temp\Folder_Permissions.csv"
Leave a Reply