Bill Long's Exchange Blog

Exchange Server stuff, focusing on Public Folders, PFDAVAdmin, ExFolders, and Powershell scripting.

Get-PublicFolderStatistics Can’t Find A Folder

Get-PublicFolderStatistics Can’t Find A Folder

  • Comments 9
  • Likes

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
  • 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

  • Thank you so much, I have been scratching my head for weeks looking for an answer to this.  I was looking at the folders through the EMC, when I selected the properties of any of my public folders each property was returning "Not available on this server" and when I right clicked any folder and selected Update Content I would get an error.

      Cannot start content replication against public folder ....

    I thought there was something wrong with the server and therfore was not to happy to proceed with the decomission of the old exchange 2003 server.

  • 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.

  • Argh - frustrating! Glad I googled it and found your article - thanks!

  • Shouldn't be that hard for MS to fix this I would think.  It works fine in Exchange 2007 PF GUI...  Get the right propeller head on it and it should be easy peasy...

  • 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?

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

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

  • 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

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment