I am fetching some folder permissions, however, I only want permissiosn that are not "NT AUTHORITY\SYSTEM" or "BUILTIN\Administrators"
My code is:
$acl = Get-Acl $path
$perm = $acl.Access | where{$_.IdentityReference -notmatch "NT AUTHORITY\SYSTEM"}
Write-Output $perm
But its still showing "NT AUTHORITY\SYSTEM" permission, how do I filter out that records I don't want?