Copy e-mails from one account to another within office 365

Dear Experts

I want to move(copy) mailbox contents (emails, contacts & calendar items) to another mailbox within the same tenant (same exchange plan). I don't want to export and import as PST simply because the size of the mailboxes and possibility of corruption.
I found the following powershell commands to transfer mailbox cotent and structure however powershell doesn't recognise the command "search-mailbox"

powershell command:
Search-Mailbox -Identity "Joe Healy"   -TargetMailbox "Jim Park"  -TargetFolder   "JoeHealy-ProjectHamilton" -LogLevel Full

Please can someone shed some light on how this can be acheived using office 365 powershell.

Many Thanks
RobKanjAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Vasil Michev (MVP)Commented:
You need to be granted permissions in order to use the Search-Mailbox cmdlet. Add yourself as a member of the "Mailbox Import Export" role in Exchange admin center -> Permissions -> Admin roles
0
Darshana JayathilakeSystem EngineerCommented:
0
RobKanjAuthor Commented:
Thank you Vasil, I'm able to run the command now. i'v tested copying all content from one mailbox to another however although i've mentioned on the script to copy all content to a subfolder all e-mails are also copied onto the inbox. so is there a way to copy all contents only to the subfolder and not to the inbox.

thanks
0
ON-DEMAND: 10 Easy Ways to Lose a Password

Learn about the methods that hackers use to lift real, working credentials from even the most security-savvy employees in this on-demand webinar. We cover the importance of multi-factor authentication and how these solutions can better protect your business!

Vasil Michev (MVP)Commented:
It will create a new folder based on the value you provide for the TargetFolder parameter. You cannot use an existing one. Here's an example

Get-Mailbox WC | Search-Mailbox -SearchQuery 'kind:meetings' -TargetMailbox sharednew -TargetFolder "blabla"

Open in new window


This will copy all meetings from the "WC" mailbox to the "sharednew" one, and place them in a folder named "blabla"
0
RobKanjAuthor Commented:
Hi Vasil,

thank you for your valuable advice on the command, below is the command I used to copy.
Search-Mailbox -Identity "john" -TargetMailbox "smith"  -TargetFolder   "copied_from_john" -LogLevel Full

Open in new window


the above code successfully created "copied_from_john" folder in Smith's mailbox and copied all the folders and e-mails from John's mailbox. however I noticed that all the e-mails from John's mailbox also have copied onto Smith's inbox as well. this is a problem as it will consume more space in Smith's mailbox as there will duplicate e-mails of john.

would you know the command to just copy all the mails and folders only on the target folder?

Thank you in advance.
0
Vasil Michev (MVP)Commented:
This shouldnt happen and I dont have a clue what might be causing it. Perhaps some rule? Is he accessing this mailbox on any mobile device or similar, that might cause the duplication?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RobKanjAuthor Commented:
Thank you.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Office 365

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.