I recently had the need to automatically retrieve and process emails. As I am using Office365 what could have been closer than trying to retrieve the emails via PowerShell and EWS. What I was not aware of is that the supplied Cmdlets that come with the “MSOnlineExtended” module only really deal with account and administration. And the Cmdlet in the OSCEXOEmailMessage module do not retrieve S/MIME messages whe you perform a search like:
#Connect to EWS first Connect-OSCEXOWebService -Credential $cred #Search for all messages in inbox $aMail = Search-OSCEXOEmailMessage -WellKnownFolderName Inbox -From "username@example.com";
I have not yet figured it out why this happens. If anyone knows feel free to share…