Export All Mailboxes to pst

Hammoudeh 346 Reputation points
2021-04-25T10:20:41.337+00:00

Hello All,

I have 2 exchange servers 2019 (DAG) and i want to export all mailboxes to pst, i run the following commands:

$AllMailboxes = Get-Mailbox

foreach ($Mailbox in (Get-Mailbox)) { New-MailboxExportRequest -Mailbox $Mailbox -FilePath "\<server FQDN>\<shared folder name>\$($Mailbox.Alias).pst" }

but did not work

90923-image.png

I did try it on single exchange server and it worked. How can i export all mailboxes.

Thank you

Office Management
Office Management
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Management: The act or process of organizing, handling, directing or controlling something.
1,576 questions
Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
6,091 questions
No comments
{count} votes

Accepted answer
  1. Eric Yin-MSFT 4,441 Reputation points
    2021-04-26T02:07:48.137+00:00

    Hi,
    Please try below commands:

    foreach ($Mailbox in (Get-Mailbox)) { New-MailboxExportRequest -Mailbox $Mailbox.alias -FilePath "\<server FQDN>\<shared folder name>\$($Mailbox.Alias).pst" }


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


2 additional answers

Sort by: Most helpful
  1. Ashok M 6,376 Reputation points
    2021-04-25T11:42:12.3+00:00

    Hi,

    I assume that $mailbox value is null and hence the command New-MailboxExportRequest is failing. Please try the below commands and see if that works,

    $Export = Get-Mailbox
    $Export|%{$|New-MailboxExportRequest -FilePath “\servername\sharedfoldername\$($.name).pst”}

    https://www.blog.edbtopst.org/how-to-export-multiple-mailboxes-to-pst-exchange-2016.html

    If the above suggestion helps, please click on "Accept Answer" and upvote it.

    No comments

  2. Hammoudeh 346 Reputation points
    2021-04-26T07:30:40.45+00:00

    @Ashok M

    91175-image.png

    did not work

    No comments