title: Listing who has Full Control to a folder in PowerShell
body: <p>I am writing a PowerShell script, and I want part of that to list who has Full Control to a given folder.  I just cannot find any examples of how to do this.</p>
  
  <p>As a test, I have a variable called $acl that points to C:\TestFolder.  My command is:</p>
  
  <pre><code>$acl.access | ForEach-Object { $_.FileSystemRights | Where-Object { $_ -eq 'FullControl' } }
  </code></pre>
  
  <p>This displays:</p>
  
  <pre><code>FullControl
  FullControl
  FullControl
  </code></pre>
  
  <p>as there is my domain account, BUILTIN\Administrators and NT AUTHORITY\SYSTEM.  However, I want it to display:</p>
  
  <pre><code>&lt;my domain account&gt;
  BUILTIN\Administrators
  NT AUTHORITY\SYSTEM
  </code></pre>
  
  <p>Eventually I will run this on network folders on my company's NAS, and there could be 10s of people with Full Control.  My ultimate goal is to evaluate the list to see if any of these accounts are a member of a specific AD group.</p>
  
  <p>Please could someone point me in the right direction?</p>
  
  <p>Thanks in advance,</p>
  
  <p>Rob.</p>