Is there a way to run a regular expression for multiple objects, so multiple objects and their output filter out the results
without having to perform an Out-String first? I was wanting to run a regex with numerous users and groups, and their standard file system rights by default and
then query against any non standard perms for various directories. However I have found that it appears to be a little bit more difficult, but can export out to a
string value, however, I'll be grabbing those results (hopefully after the filter) and exporting to CSV, so would be much easier/cleaner to filter out right after
the Select-Object statement, does anyone have any suggestions to do that?
So example:
Example:
Get-Item "C:\temp" | Get-Acl | % {$_.Access} | Select-Object IdentityReference,FileSystemRights | ? {$_ -notmatch "Administrators"}
IdentityReference FileSystemRights
----------------- ----------------
NT AUTHORITY\SYSTEM FullControl
BUILTIN\Administrators FullControl
BUILTIN\Users ReadAndExecute, Synchronize
BUILTIN\Users AppendData
BUILTIN\Users CreateFiles
CREATOR OWNER 268435456
But regex would be great to get the values like "Administrators\S*\s*FullControl" that would filter out both IdentityReference and FileSystemRights based on the regex.