Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9252867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:03:56+00:00 2026-06-18T11:03:56+00:00

I have an Exchange 2010 environment with about 1000 users across 6 databases. They

  • 0

I have an Exchange 2010 environment with about 1000 users across 6 databases. They all have archives enabled that are stored in separate databases.

I have backup software that gets the database, but I want to supplement this by doing a .pst export of mailboxes directly from Exchange. I want to take all the users in a given database and export to .pst. My command looks like below:

foreach ($i in (Get-Mailbox -database Accounting)) { 
    New-MailboxExportRequest -Mailbox $i -FilePath "\\server\D$\PSTBackup\test\Accounting\$($i.Alias).pst" -baditemlimit 50 -acceptlargedataloss 
}

The problem with this is it exports them all at once (killing our server resources) and half of them fail because there are too many running at once. I’d like a script to backup about 20 mailboxes at a time. Any help is appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T11:03:57+00:00Added an answer on June 18, 2026 at 11:03 am

    Basically you’re going to want to create a new variable that holds the results of
    Get-Mailbox -database Accounting)

    Then you can determine batch numbers programmatically using a percentage of the count of that variable or a specific number.

    $myEmailBoxes = Get-Mailbox -database Accounting

    $myEmailBoxes.count should give you how many mailboxes are in the list total. This may not be the exact syntax for exchange powershell though. While you’re testing you may want to Echo the results to the output so you know that you are getting what you expect.

    To batch the transactions use a ‘for’ loop instead of a for each and set it to the number you want to batch.

    It would look something like the following:

    $allMailboxes = Get-Mailbox -database Adjunct
    $batchSize = 2
    $currentBatchIndex = 0
    $currentBatchMailboxes
    # Call the function to start the process
    batchMailboxes
    
    function batchMailboxes {
                    for (i = $currentBatchIndex; i < $currentBatchIndex + $batchSize; i++)
                    {
                                    $currentBatchMailboxes += $allMailboxes[i]
                                    $currentBatchIndex++
                    }
    
                    exportBatchedMailboxes($currentBatchMailboxes)
                    $batchStatus = getBatchedMailboxStatus($currentBatchMailboxes)
    
                    if ($batchStatus == false) {
                                    #Execute timer to get getBatchedMailboxStatus($currentBatchMailboxes)
                    }
                    else {
                                    if ($currentBatchIndex < $allMailboxes.count - 1) {
                                                    batchMailboxes
                                    }
                    }
    }
    
    function exportBatchedMailboxes ($exportMailboxes)
    {
                    foreach ($i in $exportMailboxes) {
                                    New-MailboxExportRequest -Mailbox $i -FilePath "backuplocation\Adjunct\$($i.Alias).pst" -baditemlimit 50 -acceptlargedataloss
                    }
    }
    
    function getBatchedMailboxStatus ($batch)
    {
                    # command for checking status needs to go here using a foreach loop
    }
    

    Here’s a full implementation of the script that works perfectly http://blog.bluepegasusinc.com/index.php/batch-export-exchange-2010-mailbox-to-pst/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to list all databases in an exchange 2010 server with their mailboxes.
Right now we have AD/Exchange to manage all of our users logins/e-mail on-site at
I have a program that subscribes to multiple Exchange 2010 mailboxes using EWS Managed
I have Exchange 2010 running and i need to track all the emails. I
I have the following code that creates a PowerShell runspace with the Exchange 2010
I'm pro-grammatically reading emails from Exchange 2010 that have been sent in plain text.
We have a device that uses Exchange web services to download mail and calendar
I have a server application that needs to find and exchange small amounts of
I have a wpf app that needs to communicate(exchange data) with a custom designed
I'm writing a C# DKIM validator and have come across a problem that I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.