Hi,
You can get the permissions of the directories using the Get-Acl cmdlet and export the result to a csv file using Export-Csv. It can be something like this.
$Dirs = @("C:\temp\a","C:\temp\b")
$DirAcls=@()
Get-ChildItem -Recurse -Directory -Path $Dirs | ForEach-Object {
$Path = $_.FullName
(Get-Acl -Path $Path ).access| ForEach-Object {
Add-Member -InputObject $_ -MemberType NoteProperty -Name "FullPath" -Value $path
$DirAcls += $_
}
}
$DirAcls | Export-Csv -NoTypeInformation -Path C:\temp\DirAcls.csv
Best Regards,
Ian Xue
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.