I am looking for a way to write a powershell script that will return result for all folder that contain users or groups that are not inherited. I tried to run the script for non-inherited folder, but some folder are inherited...while have users/groups that were added later on without disabling the inheritance of the folder.
This is the script I found:
DIR "\path\abc" -directory -recurse | GET-ACL | where {$_.Access.IsInherited -eq $false}|Select-Object PSPATH |Export-Csv "c:\export.csv" -NoTypeInformation
Problem with this script is it read the folder inheritance, and not the users/groups. What is the powershell cmdlet to target users/groups without inheritance?
Below is an example of the folder in question.
https://i.imgur.com/ng58DDi.png