title: PS - Get All SMB shares with permissions
body: <p>I'm trying to get all smb shares on my windows server with all user permissions on them for inventory check.</p>
  <p>This is what i have:</p>
  <pre><code>$Shares = Get-SmbShare
  
  foreach($Share in $Shares)
  {
      Get-SmbShareAccess -Name $Share.Name | Where-Object {$_.AccountName -Match &quot;DOMAINNAME&quot;} 
  }
  </code></pre>
  <p>Which gets me all domain users with their shares and which access they have.</p>
  <p>But it only shows name of folder. I would like its gonna show full path on the server (Not UNC)</p>
  <p>And it would be exportable in csv format.</p>
  <p>When i do:</p>
  <pre><code>$Shares = Get-SmbShare
  
  foreach($Share in $Shares)
  {
      Get-SmbShareAccess -Name $Share.Name | Where-Object {$_.AccountName -Match &quot;PRAGUELOFTS&quot;} | Export-Csv -Path C:\perms.csv
  }
  </code></pre>
  <p>It only exports the last user.</p>