title: Recursively list folders and subfolders from a network share and list members of the groups
body: <p>unfortunately I'm not too well versed in powershell and my Google skills haven't fixed my problem yet.</p>
  
  <p>So far I have to following script:</p>
  
  <pre><code>Get-childitem \\network\share\ -recurse | where{$_.psiscontainer} |
  Get-Acl | % {
      $path = $_.Path
      $_.Access | % {
          New-Object PSObject -Property @{
              Folder = $path.Replace("Microsoft.PowerShell.Core\FileSystem::","")
              Access = $_.FileSystemRights
              Control = $_.AccessControlType
              User = $_.IdentityReference
              Inheritance = $_.IsInherited
              }
          }
      } | ? {-not $_.Inheritance} | export-csv output.csv -force
  </code></pre>
  
  <p>Which (partly) gives me the following output:</p>
  
  <pre><code>User                                       Folder
  $DOMAIN\network_share_sub1_write            \\network\share\sub1
  $DOMAIN\network_share_sub1_read             \\network\share\sub1
  $DOMAIN\network_share_sub1_subsub1_write    \\network\share\sub1\subsub1
  $DOMAIN\network_share_sub2_write            \\network\share\sub2
  </code></pre>
  
  <p>The problem here is that I have to look up each group to see the respective users. What I'd like to have is something like this:</p>
  
  <pre><code>User    Permission Folder
  $User1   write      \\network\share\sub1
  $User2   read       \\network\share\sub1
  $User3   write      \\network\share\sub1\subsub1
  $User1   write      \\network\share\sub2
  </code></pre>
  
  <p>Is something like this possible?
  Thanks in advance.</p>