locked
Export to pst format from Exchange using powershell RRS feed

  • Question

  • Hi friends,

    I want to export to pst format from exchange 2007 but only the 2010 period emails. Is there any way I can use the power shell command to export the emails for the period 1.1.2010 to 31.12.2010 from a users mailbox ?

    Monday, October 24, 2011 6:16 AM

Answers

  • For single user:
    Export-Mailbox –Identity <mailboxUser> -PSTFolderPath <pathToSavePST> -StartDate 1/1/2010 -EndDate 12/1/2010
    For particular DB:
    Get-Mailbox -Database 'MDB' | Export-Mailbox -PSTFolderPath D:\PSTs -StartDate 1/1/2010 -EndDate 12/1/2010
    * make sure that you are running from EMS 32 bit version
    hope this may helps.

    Thanks & Regards, Kottees R
    • Marked as answer by Jason LJS Wednesday, November 2, 2011 1:58 AM
    Monday, October 24, 2011 1:54 PM
  • Hi Karan

    You can use the New-MailboxExportRequest cmdlet (http://technet.microsoft.com/en-us/library/ff607299.aspx) with the -ContentFilter parameter (http://technet.microsoft.com/en-us/library/ff601762.aspx) set to filter by the Recieved property

    BR
    Mads 

     


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    • Marked as answer by Jason LJS Wednesday, November 2, 2011 1:58 AM
    Monday, October 24, 2011 8:21 AM
  • Hi,

    1. You need grant full access permission to the users who run this command.

    2. Outlook 2003 Service Pack 2 (SP2) or Outlook 2007

    Reference:

    http://technet.microsoft.com/en-us/library/bb266964(EXCHG.80).aspx


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    • Marked as answer by Jason LJS Wednesday, November 2, 2011 1:58 AM
    Tuesday, October 25, 2011 7:24 AM

All replies

  • Hi Karan

    You can use the New-MailboxExportRequest cmdlet (http://technet.microsoft.com/en-us/library/ff607299.aspx) with the -ContentFilter parameter (http://technet.microsoft.com/en-us/library/ff601762.aspx) set to filter by the Recieved property

    BR
    Mads 

     


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    • Marked as answer by Jason LJS Wednesday, November 2, 2011 1:58 AM
    Monday, October 24, 2011 8:21 AM
  • For single user:
    Export-Mailbox –Identity <mailboxUser> -PSTFolderPath <pathToSavePST> -StartDate 1/1/2010 -EndDate 12/1/2010
    For particular DB:
    Get-Mailbox -Database 'MDB' | Export-Mailbox -PSTFolderPath D:\PSTs -StartDate 1/1/2010 -EndDate 12/1/2010
    * make sure that you are running from EMS 32 bit version
    hope this may helps.

    Thanks & Regards, Kottees R
    • Marked as answer by Jason LJS Wednesday, November 2, 2011 1:58 AM
    Monday, October 24, 2011 1:54 PM
  • Hi,

    1. You need grant full access permission to the users who run this command.

    2. Outlook 2003 Service Pack 2 (SP2) or Outlook 2007

    Reference:

    http://technet.microsoft.com/en-us/library/bb266964(EXCHG.80).aspx


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    • Marked as answer by Jason LJS Wednesday, November 2, 2011 1:58 AM
    Tuesday, October 25, 2011 7:24 AM
  • Hi all

    If all users mailboxes are exported as above

    Can the users still login to the environment and work away

    e.g. If I tested this script and it exports all mailboxes --

    Can the users still login to their current mailboxes?

    Thanks

    Tadhg


    Tadhg Concannon

    Wednesday, November 6, 2013 2:39 PM
  • A common exercise for any script writer that works with email is to export data from a mailbox.

    PowerMapi [www.powermapi.com] makes this work easy and such can be done from any source where mapi is used.

    This example will take the common use-case of exporting data from a mailbox in Microsoft Exchange to a PST file.

    $sess = New-MapiSession outlook-main
    $sourceStore = get-mapistore $sess -GetPrimaryStore
    $sourceRootFolder = Get-MapiFolder $sourceStore -CommonFolder IPMSubtree
    $pstStore = Open-MapiPST -PstFilePath c:\temp\out.pst -Session $sess -CreateNew
    $pstRootFolder = Get-MapiFolder $pstStore -CommonFolder IPMSubtree
    Copy-MapiFolder -SourceFolder $sourceRootFolder -DestinationFolder $pstRootFolder -CopySubfolders

    The above should be self-explanatory. Additional script work could be done to track how much data is being copied into the target (to avoid exceeding the PST file size limit, for example) or to exclude folders or items. There are cmdlets to search and filter items that can make the above more capable.  The cmdlet search-MapiItems can be used to filter and export only items that match the date range requested, but also even more granular if needed, on any item attribute, including attachment and recipient data.
    Sunday, May 21, 2017 4:26 PM