I modified the command again, and it works on my Exchange 2010 SP3 ru30. Please try it on your Exchange server:
Get-PublicFolder -Recurse -resultsize unlimited | Get-PublicFolderClientPermission | Select-Object Identity,@{Expression={$_.User};Label="User"},@{Name='AccessRights';Expression={[string]::join(', ', $_.AccessRights)}},@{label="PrimarySmtpAddress";expression={(Get-Mailbox $_.User.tostring()).PrimarySmtpAddress}}|export-csv C:\location\pubpermission.csv -NoTypeInformation
This my output:
Additionally, since Exchange 2010 is end of support, we suggest to migrate to Office 365 or Exchange 2016 for better services. For your reference: Exchange 2010 end of support roadmap.
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.