Export Office 365 to The Email Laundry

If you use The Email Laundry for advanced email and threat protection and your an MSP you will know how time consuming it is to setup.

Adding all the email accounts into The Email Laundry manually, even exporting users from Office 365 to CSV and formatting the import file can be a real pain.

Well I had enough of all the manual work and wrote a little PowerShell script to speed up the process.

Before attempting to run this script please ensure all domains in the Office 365 tenant have been added to your Email Laundry account.

1. Download the following script to the root of your c: drive.

“Many thanks to James Stone at Clovertec for his addition to the script. This version has been updated to include code from his comments at the bottom of this post.. Thanks James!”

2. Open a PowerShell window as ‘Run as administrator’.

Change directory to the root of C.

cd c:\

Then Run the script


3. Sign into your clients tenant as a global admin.

The script will fetch the mailbox and group details and the output should look something like this.

4. You will now find the CSV file ready to import into The Email Laundry.


5. Log into The Email Laundry and navigate to Users, click ‘Import Users’.

Click ‘Choose File’ and select the exported CSV file and click ‘Import’.

Please comment below if this was useful to you or if you found any errors in the code.

Author: Ian@SlashAdmin

Share This Post On
468 ad


  1. Hi Ian, very useful script!

    One little point i’ve added is to filter out any X500 addresses from the SMTP array –

    if($proxyAddress -notlike “*onmicrosoft*” -and $proxyAddress -notlike “SPO:*” -and $proxyAddress -cnotlike “SMTP:*” -and $proxyAddress -notlike “X500:*”)

    Might be worth amending that, Email Laundry freaked out the first import I ran.

    Post a Reply
    • Many thanks James!

      I’ll add it to the download 😀

      Post a Reply


  1. Office 365 export import script for The Email Laundry - How to Code .NET - […] https://www.slashadmin.co.uk/export-office-365-to-the-email-laundry/ […]

Submit a Comment

Your email address will not be published.