Avatar of penndell
penndellFlag for United States of America asked on

How can you move all emails from one folder to another in Exchange Online?


I am trying to figure out how to move ALL emails from one folder to another (within the same mailbox) in Exchange Online.

When we did a PST import to O365, New folders such as "Inbox_0" and "Sent Items _0" were created. The imported emails did not merge into Inbox and Sent Items as we had expected. I need to move the emails in those folders to the "main" Inbox and Sent Items folders.. It should be a simple thing.... or so I thought. 

I know it can be done with Outlook, but takes forever that way when dealing with thousands of emails. I tried OWA, thinking that might be better, but in fact its worse, as there is no option to MOVE emails, once you "Select All" in a folder. It's just not feasible to select batches at a time, when you're dealing with thousands of emails. 

Is there a way to do this in Powershell?  I tried using the "Search-Mailbox" Powershell Command, which looked promising, but it would not le me use the same Identity as both a Source and Destination.   

Any advice would be most appreciated. Thanks very much.

ExchangeMicrosoft 365Outlook

Avatar of undefined
Last Comment

8/22/2022 - Mon

I think the only PowerShell method I am aware of would use the outlook com object (basically what you do in outlook) so I doubt it would be any faster.
If you wanted to give it a try there are several scripts out there that will do something like this.
for example here is a technet article where the answer tells how to do this. 
Moving older emails from Inbox folder to another folder using Powershell (microsoft.com) 

Andrei Fomitchev

You can create filter "move" or/and "copy" and then execute "apply filters".
Vasil Michev (MVP)

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

Thank you all for the suggestions. I have not had any luck yet getting EWS script to work, but that does seem like it should do what we need.. I will keep trying.  Thank you.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes

I was able to get the Merge-MailboxFolder.ps1  script to work properly. Thanks very much for the help.. That did the trick!