Introduction
This script can export email messages from Outlook Web App to a specific folder.
These email messages will be saved in .eml format. You need to find the email messages by using search folder.
Download the Script from here
Important Note:
Scripting is NOT supported by Microsoft Technical Support.
You have to use this script on your own risk as each environment is different for each user.
Scenarios
Microsoft Outlook allows you to export email messages very easily.
However, this feature is not available in the Outlook Web App (OWA).
Therefore, in order to export email messages from OWA, you must find a workaround.
Prerequisites
This script requires Exchange Web Service Managed API 2.0. Please download and install the package from Microsoft Download Center.
This script cannot work correctly without this package.
Let’s start and execute the script…
1.Open Windows Azure Active Directory PowerShell
2.Run Import-Module cmdlet to import this module file
Import-Module filepath\scriptname.psm1
Example:
Import-Module C:\Export\ExportOSCEXOEmailMessage.psm1
To display help about this function, run this command.
Get-Help Export-OSCEXOEmailMessage -Full
To initiate a connection to Office 365 Exchange Online, please run this command.
You must run this example before any other step.
Connect-OSCEXOWebService -Credential (Get-Credential joannav@losgrecos.onmicrosoft.com)
Note
The Connect-OSCEXOWebService function creates a new variable called exService. This variable is in the global scope of the current Windows PowerShell session. This variable is used by other functions in the script.
To create a search folder that contains the email messages with specific subject, please run this command.
New-OSCEXOSearchFolder -DisplayName “Subject contains ‘Backup'” -Subject “Backup” -StartDate “07/20/2013 12:00:00 AM” -EndDate “09/25/2013 12:00:00 PM”
To export email messages in a search folder and keep this search folder after exporting, please run this command.
Get-OSCEXOSearchFolder -DisplayName “Subject contains ‘Backup'” | Export-OSCEXOEmailMessage -Path C:\Backup -KeepSearchFolder
To export email messages in a temporary search folder, please run this command.
New-OSCEXOSearchFolder -Subject “Test email” | Export-OSCEXOEmailMessage -Path C:\Backup
Additional Resources Technical Resources:


My brother recommended I might like this website.
He used to be totally right. This publish actually made my day.
You cann’t imagine just how a lot time I had
spent for this info! Thank you!
We’re a bunch of volunteers and starting a new scheme in our community.
Your website offered us with helpful info to work on.
You have performed a formidable job and our whole neighborhood
will probably be grateful to you.
Many thanks.
Enjoy reading 🙂
My spouse and I stumbled over here by a different page and thought I may as well check things
out. I like what I see so now i am following you. Look forward to looking at your web
page for a second time.
Fascinating blog! Is your theme custom made or did you download it from somewhere?
A design like yours with a few simple adjustements would really make my blog jump out.
Please let me know where you got your theme. Thank you
Hi Lindsay,
The theme is custom I made it
I really love your website.. Great colors & theme.
Did you build this amazing site yourself? Please reply back as I’m trying to create my very own blog and want to learn where you got this from or exactly what the theme is named.
Many thanks!
Hi there,
Yes, I build it by my self.
If you want any assist for your blog, juts mail me:)
Regards,
Joanna
Great article.