Query SHARE and NTFS permissions?

(imported topic written by JamesN91)

I found this bit of code that will take care of the SHARE permissions side of things…

(name of it, path of it, (if (not exists  entries of dacls of security descriptors of it) then "n/a" else 
 
((trustee of it as string & ":" & (if ( read permission of it) then "R" else "") &(if ( write permission of 
 
it) then "W" else "" )) of entries of dacls of security descriptors of it))) of network shares whose (name 
 
of it does not contain "$")

For the same shares, would also like to report the NTFS permissions of the folder so that I have a better understanding of the effective permissions of the object.

Any help would be greatly appreciated.

(imported comment written by JamesN91)

Partial NTFS results for a share…

((account name of trustee of it & " - " & (if (generic read permission of it OR read permission of it) then 
 
"R" else "")  &  (if (generic write permission of it OR write permission of it) then "W" else "") & (if 
 
(generic execute permission of it OR execute permission of it) then "E" else "")) of entries of dacls of 
 
security descriptors of folders (paths of it), names of it) of network shares whose (name of it does not 
 
contain "$")

This is reporting accounts and not groups. I need the groups also.

Then I need a way of combining the Share Permissions with the NTFS permissions into a report that makes sense per object.