Using PFDAVAdmin to get the item count within the folders on mailboxes on an exchange servers


By now, I am sure that everyone has heard of RPC dialog box popups in Outlook. More and more, we have seen this issue being related to the number of items in users’ mailbox folders.

“That’s great” you say… “But exactly how do I determine the number of items in each user’s mailbox and folders?” The Exchange System Manager (in Exchange 2000 and 2003) only shows the total number of items and opening each user’s mailbox to determine the count is too time consuming.

I thought about using some tools that we already have and decided to see if PFDAVAdmin would fit the bill.

The first thing is to download the latest version of the PFDavAdmin utility from the download site below:

http://www.microsoft.com/downloads/details.aspx?FamilyID=635be792-d8ad-49e3-ada4-e2422c0ab424&DisplayLang=en

To get a listing of the number of mail items for each folder within each mailbox, follow the steps below:

1. Launch PFDAVAdmin by double clicking on the file; PFDavAdmin.exe

2. On the File menu, select Connect.

The “Connect” dialog will then appear as shown below.

  • In the Connect dialog box, enter the name of the Exchange Server the mailboxes reside on.    
  • Check the “Authenticate as currently logged on user” checkbox.
  • Select “All mailboxes” under Connection and click OK.

3. On the Tools menu, select Options. Check the “Enable logging to file” checkbox and click OK.

The “Options” dialog box will then appear as shown below.

  • Make sure that the box labeled; “Enable logging to file”, is checked.
  • Make sure that the box labeled; “Enable extended logging”, is unchecked.

4. On the Tools menu, select Export Properties.

The “PropertyExportForm” will now appear as shown below.

  • Select “All folders”.
  • Create an Output File such as c:\ItemCount.txt by clicking on the Ellipse button, “

The “Save As” dialog box will now appear as shown below:

  • Browse to the folder where you want to save the file.
  • Enter the file name, “itemcount” and select “Text file (*.txt)” as the “Save as type”.
  • Finally click on the Save button to create the export file.

  • Uncheck all of the Properties to export except for the following:

                        PR_CONTENT_COUNT : 0x36020003

                        PR_DISPLAY_NAME : 0x3001001E

                        PR_FOLDER_PATHNAME : 0x66B5001E

5. Click on the button labeled, “OK”.

PFDavAdmin will start to process all of the folders within the mailbox and will display a progress bar.

When the Export Properties process completes, simply close the dialog box and exit out of the PFDavAdmin utility.

Next, open the file in Microsoft Excel to sort the data in descending order.

1. In Excel, open the ItemCount text file:

2. The Text Import Wizard starts. Make sure that Delimited is selected under Original data format. Click Next.

3. Make sure that Tab is selected as the delimiter. Click Finish. The file should now open.

4. Select the cell D2 which in this example contains the value “597,557”. Then select the Sort Z to A tool from the ribbon.

The result is shown as follows:

As we can see, there are several users that have more than 5,000 items in some of their mailbox folders. In this case, we definitely want to clean up the number of items in the critical path folders – Inbox, Sent Items and Deleted Items. The user eileen.orourke also has two other folders with a lot of items – Search Folder and NEED TO FILE. These don’t need to be cleaned up unless they are heavily used.

For more information about Outlook and performance, please see the knowledge base article for additional information:

905803 Outlook users experience poor performance when they work with a folder that contains many items on a server that is running Exchange Server 2003 or Exchange 2000 Server
http://support.microsoft.com/default.aspx?scid=kb;EN-US;905803

See the previous post on this Blog on Mailbox size limits:

Recommended Mailbox Size Limits
http://msexchangeteam.com/archive/2005/03/14/395229.aspx

One additional note – to accomplish this, you could have also used the Content Report functionality that PFDavAdmin has. For more details on that functionality, see this post which can be adapted to use on mailboxes too. Exporting as described in this post might have a performance advantage though.

Eileen O’Rourke

Comments (8)
  1. Andrewva says:

    Great post Eillen.  

    I suspect most people will be using this technique when working to resolve performance problems.  Given that this is likely interrogating each mailbox, I assume that we’re likely going to place a significant load on the Exchange server that may already be experiencing performance issues.  Although this may be obvious to many, perhaps a quick blurb on the potential impact of performing these types of queries might be valuable to those who might “try this at home”.

  2. JohnB says:

    Hi,

    I use PfdavAdmin on a regular basis. One of the tasks I am usually being asked is how many items are in specif folder like Contact, Calendar or even a custom folder under the inbox folder. Is there a way to do that using pfdavadmin instead of getting a count on all folders?

    Thanks

  3. Bill Long says:

    Andrew, running a Property Export like this should have almost no performance impact, mainly because we’re requesting a very small set of properties on only a few folders at a time. A Content Report will put a slightly higher load on the server, since it actually looks through the items in the folder.

    John, yes you can do that using Custom Bulk Operation from the Tools menu. Just go to Tools -> Custom Bulk Operation. Leave the Base set to Mailboxes. In the Overall Filter you can filter by any MAPI property by specifying its hex value. For instance, if you only wanted to do folders named "Calendar", you could filter on PR_DISPLAY_NAME like so:

    (&(0x3001001E=Calendar))

    If you wanted to do any folders where the default message class is appointment, you could filter on PR_CONTAINER_CLASS:

    (&(0x3613001E=IPF.Appointment))

    Once you’ve determined your Overall Filter, hit Add to add a new operation. Choose "Other Folder Properties" and click OK. Change the Action to "Export", specify an export file, and then choose each Property you want to export from the dropdown list and hit Add. Click OK when you’re done building the list of properties, and then click OK in the Custom Bulk Operation window when you’re ready to run it.

    You can find some other examples of using Custom Bulk Operation in a couple of previous blog postings. I described how to export permissions on all public folder calendars here: http://msexchangeteam.com/archive/2007/02/16/435378.aspx. I describe how to set permissions on all mailbox Calendar folders for languages where it shows as something other than "Calendar" here: http://msexchangeteam.com/archive/2006/06/13/427944.aspx.

  4. Pkillur says:

    Hey, thanks for that tip.  I was puzzling over a user’s 3.2 gig mailbox a couple of days ago wondering "how many fricken’ emails is that".  

    And now I know!

    9826 in inbox + about 26,000 in others.  

    Not quite 3 million, but a whole lot more than average!

  5. Varadhan says:

    I tried PFDAVAdmin on a newly installed Exchange 2007 server test setup and couldn’t get it to authenticate properly.  I have only http enabled and not https.

    I have entered all the details as mentioned in the article and when I expand the "Mailbox" tree in the tool, I get "Could not expand
    https://164.99.168.242/exchange/: Object reference not set to an instance of an object".

    How can I fix this?

  6. Jose Mauro Barron says:

    Thanks for this information. Quite invaluable.

  7. Venkat says:

    Hi,

    I am trying to read “message count” from a specific custom created folder from multiple mailboxes in a single server. The PFDAVADMIN tool presents what I want – But it either gives for one mailbox or all mailboxes in one server. Can I pick and choose the mailboxes I need to have information and run it once?

    Else can I do the same using command line? I saw “-scope” option accepting mailboxes as a parameter for export permissions. The same scope option does not accept mailboxes when it comes to content report. Am I missing something?

    Since I need to run this for a reporting functionality on a daily basis – This is very critical for me.

    Any help is most welcome.

    Thanks

    Venkat

  8. Venkat says:

    I figured it out. The -scope Mailboxesusername should be provided as a last option.

    Thanks,

    Venkat

Comments are closed.