PowerShell: Search public folders for items of a particular message class (ItemClass) No ratings yet.

In addition to the mailbox search script, I have also written a sample script showing how to do the same search against public folders.  It works in exactly the same way, but iterates public folder tree instead of the mailbox.

The EWS Managed API needs to be installed on the machine running the script, but it does not need to be run on an Exchange server.  Example syntax:

.\Search-PublicFoldersForMessageClass <mailbox smtp address> <message class>

Full list of parameters:

  -Mailbox: Specifies the mailbox to be used to obtain autodiscover information
 -MessageClass: Specifies the message class of the items being searched
 -AuthUsername: Username used to authenticate with EWS (if omitted, the logged in user’s credentials are used)
 -AuthPassword: Password used to authenticate with EWS
 -AuthDomain: Domain used to authenticate with EWS
 -Impersonate: Whether we are using impersonation to access the mailbox (defaults to false)
 -EwsUrl: EWS Url (if omitted, then autodiscover is used)
 -EWSManagedApiPath: Path to managed API (if omitted, a search of standard paths is performed)
 -IgnoreSSLCertificate: Whether to ignore any SSL errors (defaults to false)
 -LogFile: Log file – activity is logged to this file if specified (if omitted, it is just written to console)



Please rate this

Leave a Reply

Your email address will not be published. Required fields are marked *