Export and remove mailbox content in Exchange 2010

AXISHK
AXISHK used Ask the Experts™
on
Is it possible to export the mail to a pst and remove the content  in Exchange 2010 within a single step ?


New-MailboxExportRequest -Mailbox <user> -FilePath \\<server FQDN>\<shared folder name>\<PST name>.pst

Thx
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Costas GeorgiouNetwork Administrator

Commented:
i have done this by exporting emails first and then deleting the mailbox and recreate a new one with the same name.
Which in effect will have the same result.

Author

Commented:
Want to look for a powershell solution, as I have over a hundred of disable mailbox that need to clean up in the server,

Thx
Commented:
New-MailboxExportRequest -Mailbox AylaKol -FilePath \\MBX-01\PSTFileShare\Ayla_Recovered.pst
Remove-MailboxExportRequest -Identity "Ayla\MailboxExport"
Remove-Mailbox -Identity contoso\AylaKol

Open in new window


You may or may not need a pause before the Remove-MailboxRequest is executed to give the export time to complete

Author

Commented:
Thx

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial