I am stuck with what I thought was going to be an easy task, I am trying to get a list of all NTFS permissions for shares. It started out pretty easy, I use $ACL = (Get-Acl -Path $Share).Access where $Share is a valid share on the computer. I can write-output $ACL and all looks great, no problem, however if I try to manipulate $ACL all I get back is
System.Security.AccessControl.FileSystemAccessRule over and over again.
I have tried all string manipulation tricks that I can think of, however the results are the same.
Question is, is there anyway to prevent this from happening and just get the proper data or is this not possible with PowerShell?
Thanks in advance
$share = '\\myserver\share' $acl = (Get-acl -path $share).access $acl | select-object -property IdentityReference, FileSystemRights
Will give you a table like
Is this the sort of thing you're looking for, or something else? Obviously you can enumerate the list of shares and run them through a foreach to go through them all.
Thanks for the help I appreciate it.
With your code I still get the same error, it seems that $acl is valid, but if you try and manipulate it in any way you get System.Security.AccessControl.FileSystemAccessRule returned
$Total="These are the ACLs " +$acl
Both return the System.Security.AccessControl.FileSystemAccessRule
Also it seems that if I write it to a file, I get the same results.
I am using Windows 10 with PowerShell 5, is this perhaps a bug in PowerShell?
I found a module NTFSSecurity that has no issues doing this, however I would prefer to do this manually
$acl is an object but not a fine formatted string!
Try for example
that happen because FileSystemAccessRule class doesn't have it own
if you want to get total count of $acl records – use
and so on...
Thanks for help, you nailed it with that one. I don't know exactly why it I was having the issues, I will delve more into this weekend for sure. The main thing is that I am over this hurdle and continue on with this script
Many thanks to all
You must be logged in to reply to this topic.