title: Get ACL Folder & Subfolder + Users Using Powershell
body: <p>Is it possible to get the permissions of a folder and its sub-folders then display the path, group, and users associated to that group? So, to look something like this. Or will it have to be one folder at a time.</p>
  
  <p><strong><code>-Folder1</code></strong></p>
  
  <pre><code>-Line separator
  -Group
  -Line separator
  -List of users
  </code></pre>
  
  <p><strong><code>-Folder2</code></strong></p>
  
  <pre><code> -Line separator
   -Group
   -Line separator
   -List of users
  </code></pre>
  
  <p>The script I've come up with so far be warned I have very little experience with powershell. (Don't worry my boss knows.)</p>
  
  <pre><code>Param([string]$filePath)
  
  $Version=$PSVersionTable.PSVersion
  if ($Version.Major -lt 3) {Throw "Powershell version out of date. Please update powershell." }
  
  Get-ChildItem $filePath -Recurse | Get-Acl | where { $_.Access | where { $_.IsInherited -eq $false } } | select -exp Access | select IdentityReference -Unique | Out-File .\Groups.txt
  
  $Rspaces=(Get-Content .\Groups.txt) -replace 'JAC.*?\\|','' |
   Where-Object {$_ -notmatch 'BUILTIN|NT AUTHORITY|CREATOR|-----|Identity'} | ForEach-Object {$_.TrimEnd()}
  $Rspaces | Out-File .\Groups.txt
  
  $ErrorActionPreference= 'SilentlyContinue'
  $Groups=Get-Content .\Groups.txt
  ForEach ($Group in $Groups)
  {Write-Host"";$Group;Write-Host --------------
  ;Get-ADGroupMember -Identity $Group -Recursive | Get-ADUser -Property DisplayName | Select Name}
  </code></pre>
  
  <p>This only shows the groups and users, but not the path.</p>