I was helping a customer review their infrastructure when we started looking at an error they were getting when accessing public folders.
When we were looking at the details, on an Exchange 2010 server we ran the command Get-PublicFolderStatistics –Identity “PublicFolderName”. The command unexpectedly returned the error:
Couldn't find public folder "\PublicFolderName" on server "ServerName.contoso.com".
+ CategoryInfo : InvalidData: (\PublicFolderName:PublicFolderIdParameter) [Get-PublicFolderStatistics], InvalidOperationException
+ FullyQualifiedErrorId : 6FB6D023,Microsoft.Exchange.Management.MapiTasks.GetPublicFolderStatistics
The error above means it didn’t find the public folder. I then tried Get-PublicFolderStatistics –Identity “PublicFolderName” –Server “ServerName” to narrow the request down, but got the same error. We also looked at the Exchange Management Console and while we could see the public folder in the tree, we couldn’t get public folder statistics.
This led me to believe that the public folder wasn’t replicated from the source server, which was Exchange 2003. It didn’t come to my attention until after having the customer work with some of our Escalation Engineers that the issue was not replication, but a bug that I didn’t know about!
What I know now is that when you run Get-PublicFolderStatistics, it returns only the first 100 public folders from the list. Even if you run it with the -Identity parameter to look for a specific folder, you will only get the expected result if your folder is in that first group of 100. If the folder you are trying to look up happens to be any number higher than 100 in the list, the command generates an error stating that the folder can’t be found.
A fix may be coming in a future software update, but I don’t know which one or when. Until it does, however, there is a workaround: run the command with the –ResultSize parameter and specify Unlimited. This means that your Get-PublicFolderStatistics –Identity “PublicFolderName” command becomes Get-PublicFolderStatistics –Identity “PublicFolderName” –ResultSize Unlimited. Now you should be able to find your folder even if it’s not one of the first 100 folders in the system. And any “folder not found” error you receive should be a little more believable!