Freigeben über


Get-PublicFolderStatistics Can’t Find A Folder

On Exchange 2010, when you use the Get-PublicFolderStatistics command to look for the statistics of a particular folder, you may see an error like this one:

image

The cmdlet throws an InvalidOperationException saying that it “couldn’t find public folder”. However, if you look at the replica list, it clearly indicates that there is a replica on that server. This is because Get-PublicFolderStatistics is doing something sneaky in the background without warning you.

If you run Get-PublicFolderStatistics with no other parameters, you’ll see this message:

image

At the end of the list of results, it is warning you that it didn’t return the whole list of folders – it only returned the first 100. You have to use -ResultSize Unlimited to get the entire list.

When you run Get-PublicFolderStatistics and specify a particular Identity, the same thing is happening in the background, but it doesn’t warn you. By default, it only returns the first 100 folders and looks through those for a matching Identity. If the folder you specified doesn’t happen to be one of the first 100, the command fails to find it.

To make this work, you need to add -ResultSize Unlimited to the command:

image

With that command, it is able to search the entire list of folders to find the one the user specified.

Hopefully this helps anyone out there who is confused by the behavior of this cmdlet. On a recent case, quite a bit of time was spent before we understood why the command was failing to find the folder!

Comments

  • Anonymous
    January 01, 2003
    We do have a fix planned for an upcoming rollup, but it didn't make it into Sp1 RU3.

  • Anonymous
    January 01, 2003
    This fix was included in SP1 RU4, which was released a few days ago. The article is KB 2504453.

  • Anonymous
    January 01, 2003
    Yeah, that's because the GUI suffers from the same problem, and of course, in the GUI you can't pass the -resultsize unlimited parameter to work around it. We are looking at ways to fix this, but I don't know if or when a fix will be done yet.

  • Anonymous
    October 28, 2010
    Thank you for the helpful information! But I have another problem. On some public folders when I try to view information about folder or statistics of folder I get the error "Not available on this server" Can you help me? img638.imageshack.us/.../pf1k.jpg img545.imageshack.us/.../pf2zj.jpg

  • Anonymous
    November 19, 2010
    The comment has been removed

  • Anonymous
    December 23, 2010
    Argh - frustrating! Glad I googled it and found your article - thanks!

  • Anonymous
    January 06, 2011
    The comment has been removed

  • Anonymous
    February 14, 2011
    Any chance this will be fixed in rollup 3?!  We have rollup 2 for SP1 installed and the bug still exists which is just shocking to be honest!  I spent ages looking into why powershell was showing replicas and users could see the public folders but the GUI was reporting issues.  I thought something was wrong in the exchange server itself but it turns out to be a simple bug that surely MS can easily resolve?

  • Anonymous
    February 28, 2014
    This little pipeline is VERY handy when you need a specific folder and don't have the full parent path!
    "get-recipient $PublicFolderName | get-publicfolder | get-publicfolderstatistics" | fl