Exporting mailbox from office 365 using powershell

I have an on premise MS environment, but our email is hosted in 0365.  We synch our AD using AZURE directory services.I want to automate a user leaving via scripts attached to a OU in the AD.  One item is to archive their mailbox to a file server share, the other is to archive their One Drive data  to a file share.  The file share will be the users 'user profile' folder  Is this possible using powershell ? I've been told not.
patrick mylneAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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:
No. First of all, there is no "export mailbox" functionality in O365. The closest you can get is to run an eDiscovery search and export the resulting PST file. However, this export operation can only be performed via the UI.

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
Ajit SinghCommented:
How to export Office 365 mailboxes to Outlook PST - Using eDiscovery PST Export
patrick mylneAuthor Commented:
thanks both.  very frustrating.  i guess I would have to install an exchange server to create a hybrid environment.
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

From novice to tech pro — start learning today.