Scenario: You want to search a mailbox via PowerShell for any messages of a specific message class.
The link below contains a script that can be downloaded. I ran it from PowerShell to look for a CommVault message class (IPM.Note.Commvault.Galaxy.Stub) that would show if we have any stubbed messages in a users mailbox with success. Note: I had to change the location of the webservices.dll in the script.
.Search-MailboxForMessageClass.ps1 email@example.com IPM.Note.Commvault.Galaxy.STub
PowerShell: Search mailbox for items of a particular message class (ItemClass)