I’m attempting to read the messages from my mailbox using PowerShell 4.
I can open my mailbox, and I can enumerate the folders.
I can’t seem to find a way to read messages from the folders, and wonder if anyone has some code they would like to recommend for doing so with Office 365 latest as of this date.
I would like to be able to read messages from my inbox as well as my online archive (which I have not found a way to access as of yet), enumerate them, and be able to output their content (subject, from addresses, message, etc)
As far as I’m aware (and I could be wrong), the Exchange commands don’t include anything for reading content from mailbox items. That would include O365.
However, O365 supports the IMAP protocol. You could certainly use that to access the contents of a mailbox, but there are no native command sfor doing so. /n software’s PowerCmdlets may offer an IMAP option.
The trick was discovering that Exchange Office 365 could be accessed with the Microsoft.Exchange.Webservices dll, and then
binging for : “powershell microsoft.exchange.webservices.dll” …
I’ll remember that algorithm in the future, since I’m a C#/>net developer. If searches for what you want to do like “powershell read email” don’t turn up anything, look up how one would do it in C#, and find the object name, and search for that.