• 0

[Req] Batch Export PST's from Exchange 2010


Question

I have been exporting PST files for our company for terminated employees one by one and it takes a rather considerable amount of time to set each one up. Is there any method to just tell it to export from a list, or group?

 I am just trying to find a quicker way of exporting large groups of people.

 

I have been using the following command in powershell.

 

New-MailboxExportRequest -Mailbox username -FilePath "\\servername\Share\user.pst"

9 answers to this question

Recommended Posts

  • 0

Which version of Exchange are you using?

 

you can use a for-each cycle and a CSV file to check each mailbox and export it to a network share or volume; the CSV file must have a Alias column and the mailbox alias you want to export.

foreach ($i in (Import-Csv .\maiboxes.csv)) { New-MailboxExportRequest -Mailbox $i.Alias -FilePath "\\servername\share\$($i.Alias).pst" }

or you can export all the mailboxes in a single OU:

foreach ($i in (Get-Mailbox -OrganizationalUnit Marketing)) { New-MailboxExportRequest -Mailbox $i -FilePath "\\servername\share\$($i.Alias).pst" }

The above exports all the users mails to a network share PST with the user alias as the name of the PST; it will fetch the users mailbox in the Marketing OU.

 

Remember that this is resources consuming task; it will make the server crawl if done careless!

 

Edit: use this to check for the status of the queue.

Get-MailboxExportRequest | Remove-MailboxExportRequest
  • 0

i was hoping more for like a batch file or something. We wont be able to purchase something as they will just tell me to do it manually like i have been.

 

we just have a lot of turnover, so once a month or so i have to export a few hundred accounts.

  • 0

"so once a month or so i have to export a few hundred accounts."

every month is a few hundred, yeah that's a bit of turnover ;)

If you have your command, just run it in a loop with an array of your names.

here this should help

http://powertoe.wordpress.com/2009/12/14/powershell-part-4-arrays-and-for-loops/

  • 0

Well i just found this, but it keeps failing because its not naming the PST file at all, its just ".pst.pst"

 

$Export = Get-Content .\Mailbox.txt

 

$Export|%{$_|New-MailboxExportRequest -FilePath "\\servername\pst\$($_.alias).pst"} 

 

It will queue them up properly just it names the first file ".pst.pst" and then cannot create the remaining files because there is a duplicate name.

  • 0

Ok,

 

For anyone in the future with this issue this is what i did

 

$Export = Get-Content .\Mailbox.txt

 

Contents of mailbox.txt

 

Username1

Username2

Username3

$Export|%{$_|New-MailboxExportRequest -FilePath "\\servername\pst\$($_).pst"} 

 

This created an export request for each user account in the list.

 

I would prefer to do it using the whole ou as it would be easier to manage (wouldn't have to create a list) but this worked for me.

  • 0

Ok,

 

For anyone in the future with this issue this is what i did

 

$Export = Get-Content .\Mailbox.txt

$Export|%{$_|New-MailboxExportRequest -FilePath "\\servername\pst\$($_).pst"} 

 

This created an export request for each user account in the list.

 

I would prefer to do it using the whole ou as it would be easier to manage (wouldn't have to create a list) but this worked for me.

 

did you see my post? It's the same but in a more elegant way :D

also you can use the Get-Mailbox -OrganizationalUnit to export a whole OU.

  • 0

did you see my post? It's the same but in a more elegant way :D

also you can use the Get-Mailbox -OrganizationalUnit to export a whole OU.

Yes i saw it, not really a fan of using the foreach on the server though. But it did actually help me resolve my issue with how i was doing it. And i took the advice and created an OU of users to export rather than making a list. it helped out a lot.

This topic is now closed to further replies.
  • Posts

    • I just started using Teams (and “New” Oiutlook) at work (instead of Slack) and both are truly abysmal pieces of software.
    • If you are willing to go to approx $200, then as mentioned in your other thread I think a refurbished Pixel 8 will be a great deal that will last you for years. I recently recommended that to someone at work, he was on a strict £200 budget, which got him an excellent conditioned refurbished Pixel 8 here. He's since told me its the best phone he's ever had and feels its a massive upgrade over his old Samsung A series device. I don't know the sites which deal in refurbished devices in the US, however I’m sure you will have some options like we do here. Failing that Ebay is also quite good in my experience. If you wanted something a bit cheaper, then you could maybe go for an older Pixel 7, these will still get security updates until the end of 2027. Even after that you have good third party OS support from LineageOS. It doesn't have to be a Pixel though, you can buy many older devices for a good deal that would be better than a new $100 phone and flash LineageOS to them: https://wiki.lineageos.org/devices/
    • I don't use one drive, but then I don't use any cloud storage, not even Icloud on my mac. If I did use cloud storage, then I would not use One drive, not because there is anything wrong with it, but because I can use Icloud. The only reason I see to use one drive is if your job requires you to have access to it
    • Not built in, which is not a bad thing. There are ways of adding cloud storage to it, Dropbox is the most well know that also have a client for Linux, but there are others.
  • Recent Achievements

    • First Post
      DragonOfMercy earned a badge
      First Post
    • First Post
      bella52 earned a badge
      First Post
    • Reacting Well
      Techinmay earned a badge
      Reacting Well
    • Collaborator
      WndSks went up a rank
      Collaborator
    • One Month Later
      Sopa flores earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      495
    2. 2
      PsYcHoKiLLa
      206
    3. 3
      +Edouard
      153
    4. 4
      Steven P.
      85
    5. 5
      ATLien_0
      75
  • Tell a friend

    Love Neowin? Tell a friend!