Could someone explain something to me? If I run the command (get-acl .\test.txt) | Select-Object owner
, I get
Owner
-----
BUILTIN\Administrators
which is what I was expecting. However, if I run the command (get-acl .\test.txt) | Select-Object Access
, I get this:
Access
-----
{System.Security.AccessControl.FileSystemAccessRule,System.Security.AccessControl.FileSystemAccessRule, System.Security.AccessControl.FileSystemAccessRule}
instead of the list of the users/groups who have permissions on that file and what those permissions are. So what am I doing wrong?
The
Access
property contains an array. You can expand it without walking a loop:Those objects don't have a pretty string conversion when you're trying to print them, so they spit out their object type.
Try something along these lines: