How to Count Folder Items in Exchange Mailbox Folders

Count Folder Items in Exchange Mailbox Folders

CHUONG K. NGUYEN – BSc., MCSEx2, MCSAx2, MCP, MCTS, MCITP, CCNA

I would like to list how many items I have in my Inbox and Contacts folders. This guide will show you how to do that from Microsoft Exchange PowerShell.

First, show all commands that have the word folder in it. I found that the command Get-MailboxFolderStatistics might do the job.

Now we should show all the members for the Get-MailboxFolderStatistics command. I find that there are three members that are interesting and could be helpful. They are

  • FolderSize
  • ItemsInFolder
  • Name

     

We will use Select-Object to show these members.

Get-MailboxFolderStatistics -identity chuong | Select-Object Name, ItemsInFolder, FolderSize

Now we should filter out only the Inbox and Contacts folders using the Where clause.

Get-MailboxFolderStatistics -identity chuong | Where-Object {$_.name -match “Inbox|Contacts”} | Select-Object Name, ItemsInFolder, FolderSize

That’s it!