export mailbox in exchange 2010 using powershell

Posted on 2012-09-02
Last Modified: 2012-09-12
Hi experts,

 I was given task to archive a particular mailbox in exchange 2010. This mailbox have emails from last year( not good ! ).I have 2 problem to perform this task :

1. mailbox size is huge > 10G
2. lack of powershell scripting skills

* I do use powershell to perform simple things like report mailbox size

Requirement :

Create powershell script , that would able to export to PST for certain date (montly) and delete that time frame emails from the actual mailbox after exporting. The idea is to archive the old emails and bring back the mailbox to normal size ( < 1G) with only having emails from last month .

Please let me know if you need any more information. Let's just say ,
Mailbox name : bigbrother
domain :
Database : DB1
(fqdn) exchange server name :

Question by:nathanq8
    LVL 14

    Assisted Solution

    open the exchange management shell

    In order to Export the entire mailbox content to a PST file we need to run the following command:

    New-MailboxExportRequest –Mailbox bigbrother –FilePath “\\<servername>\Sharename\bibrother.pst”

    if your username does not have access to export/import feature somebody needs to give you the right

    New-ManagementRoleAssignment –Role “mailbox import export” –User “Admin”
    LVL 14

    Assisted Solution

    In order to confirm the status of the mailbox export request we can run:


    checkitout here
    LVL 24

    Expert Comment


    Author Comment

    Thanks theruck,

    I did try the command for other mailbox , it went all ok. How to change the script for specific range of date ?
     Is it possible to export the email to PST with specified date range and after completion delete the exported email from mailbox  ? The mailbox size is 10G ,
    I won't able to run export in one go , it will slowdown the network and server performance . I tried once , it ran for 1.5 days for full PST over weekend.

    LVL 18

    Accepted Solution

    You may try this Export-Mailbox (Exchange 2007) cmdlet to export data within the date ranges:

    Export-Mailbox -Identity <MailboxIdParameter> -StartDate "<Month/Day/Year>" -EndDate "<Month/Day/Year>" -PSTFolderPath <Path_Of_PST_Folder>\<File_Name>.pst

    Open in new window

    Not sure it will work on Exchange 2010, I have no such exchange 2010 yet

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    Disabling the Directory Sync Service Account in Office 365 will stop directory synchronization from working.
    In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…
    With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now