Exchange Mailbox Report on Messageclass

Niroshan Selvarajah 1 Reputation point

Hello All,
Is there a way to find out what type of messages are in a user mailbox and the count.
Example: Find out the Items based on Message class. What we want to do is check how many archived Items are there in the mailbox and the number of items not archived.
Thank you

Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,204 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,274 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Yuki Sun-MSFT 40,016 Reputation points

    Hi @Niroshan Selvarajah ,

    To the best of my knowledge, you might need to use EWS script in order to find items based on message class. Here are some relevant links for your reference:
    List number of messages by message class Exchange 2007
    [Exchange 2010 : Search and Delete Items by MessageClass EWS method

    If you need further help on writing the EWS script, it's recommended to post with the tag "office-exchange-server-dev" which is dedicated for Exchange development issues.

    However, regarding to the example mentioned in your post, which is about counting the archived items in a mailbox, do you mean you would like to know the items in the archive mailbox of a user? If this is the case, you can take advantage of the Get-MailboxFolderStatistics cmdlet with the -archive parameter. For example, to view the statistics for User1's archive mailbox, the following command can be used:

    Get-MailboxFolderStatistics -Identity user1 -Archive | Format-Table Identity,ItemsInFolderAndSubfolders  


    If you want to view the statistics for User1's primary mailbox, you can use the above command without the -archive parameter.

    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.