title: Get-Acl does not seem to work on UNC path?
body: <p>I have difficulty getting <code>Get-Acl</code> to work on a UNC path to get the share permissions of a directory and all underlying files and directories. </p>
  
  <p>The code I use looks like this: </p>
  
  <pre><code>$OutFile = "C:\Users\xxxx\Desktop\Permissions.csv"
  $Header = "Folder Path,IdentityReference,AccessControlType,IsInherited,InheritanceFlags,PropagationFlags,FileSystemRights"
  del $OutFile
  Add-Content -Value $Header -Path $OutFile 
  
  $RootPath = "\\intranet\sites\folder1\folder2\target-folder-as-root"
  
  $Folders = dir $RootPath -Recurse 
  #| where {$_.psiscontainer -eq $true}-recurse
  
  foreach ($Folder in $Folders) {
      $ACLs = Get-Acl $Folder.Fullname | ForEach-Object { $_.Access }
      foreach ($ACL in $ACLs) {
          $OutInfo = $Folder.Fullname + "," + $ACL.IdentityReference  + "," +
                     $ACL.AccessControlType + "," + $ACL.IsInherited + "," +
                     $ACL.InheritanceFlags + "," + $ACL.PropagationFlags + "," +
                     $ACL.FileSystemRights
          Add-Content -Value $OutInfo -Path $OutFile
      }
  }
  </code></pre>
  
  <p>Not taking into account the filename size limit issue this might cause, I get the following error: </p>
  
  <pre>Get-Acl : Method failed with unexpected error code 1.
  At C:\Users\xxxx\Documents\ntfs_permissions.ps1:12 char:10
  +     $ACLs = Get-Acl $Folder.Fullname | ForEach-Object { $_.Access }
  +             ~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : NotSpecified: (:) [Get-Acl], InvalidOperationException
      + FullyQualifiedErrorId : System.InvalidOperationException,Microsoft.PowerShell.Commands.GetAclCommand</pre>
  
  <p>I find documentation on listing the shared permissions on a shared drive using the UNC path (I don't want to list the permissions starting from the root, but only starting from a subfolder) is very limited.</p>