title: Exporting Public Folder ClientAccessPermissions to csv
body: <p>So, I thought that it should be easy enough to
  A) Export a list of all our Public Folders
  B) Export a list of all our Public Folders with users who have access + access rights. And format it properly -_-</p>
  
  <p>As it turned out, I was wrong, and I'm hoping someone can help me.</p>
  
  <p>A) Get-PublicFolder -identity '\Legal Department' -Recurse -ResultSize Unlimited
  Lists all the public folders one by one as expected. Good Stuff.</p>
  
  <pre><code>Get-PublicFolder -identity '\Legal Dept' -Recurse -ResultSize Unlimited | ft -property Identity | Out-String | Out-File X:\Legal.PF.txt
  </code></pre>
  
  <p>This one... not so much. After around 10k-18k Public Folders it just stops writing and in one case Powershell crashed with  a warning message. 
  It was quite hilarious.</p>
  
  <p>Is there a way around this?
  (In case you're wondering, I'm using Out-String to avoid truncation.)</p>
  
  <p>B) Here I am really quite stuck.
  I have tried:
      Get-PublicFolder -identity '\Legal Dept' -Recurse -ResultSize Unlimited | FT Identity,User,AccessRights | Out-String -Width 512 | Out-File C:\Legal.PF.Perm.txt</p>
  
  <p>If I just use a subset, i.e. '\Legal Dept\A\Arn', then this works fine, but the formatting is terrible with so many spaces between the columns.</p>
  
  <p>So I've tried to export to csv, but with no luck.</p>
  
  <pre><code>Get-PublicFolder -identity '\Legal Dept\A\Arn' | Get-PublicFolderClientPermission | FT Identity,User,AccessRights | Export-CSV C:\Legal.PF.Perm.CSV -encoding "Unicode" -notypeinformation
  </code></pre>
  
  <p>Just gives me this:
  "ClassId2e4f51ef21dd47e99d3c952918aff9cd","pageHeaderEntry","pageFooterEntry","autosizeInfo","shapeInfo","groupingEntry"
  "033ecb2bc07a4d43b5ef94ed5a35d280",,,,"Microsoft.PowerShell.Commands.Internal.Format.TableHeaderInfo",
  "9e210fe47d09416682b841769c78b8a3",,,,,
  "27c87ef9bbda4f709f6b4002fa4af63c",,,,,
  "27c87ef9bbda4f709f6b4002fa4af63c",,,,,</p>
  
  <p>Not really much use :-/
  Can anyone see what I'm doing wrong?</p>