Here are two lines of powershell code to get the list of mail enabled public folders in Exchange 2013, I found a lot of examples around the net, some working but complex other not working at all, others gave back a list in text format but not the real objects… in the end I have put together a few to get what you want easily:
Get-PublicFolder “\” -Recurse -ResultSize Unlimited | Get-MailPublicFolder -ErrorAction SilentlyContinue
The parameter “-ErrorAction SilentlyContinue” is needed because we could have also some public folder not mail enabled and giving them in input to Get-MailPublicFolder obviously would return an error.
This script is very useful if you have to change some parameter on all email enabled public folder or just to have a list for documentation.