Jump to content



Photo

[Req] Batch Export PST's from Exchange 2010

Answered Go to the full post exchange 2010

  • Please log in to reply
9 replies to this topic

#1 Geoffrey B.

Geoffrey B.

    LittleNeutrino

  • Tech Issues Solved: 11
  • Joined: 25-July 05
  • Location: Ohio
  • OS: Windows 7 Ultimate
  • Phone: Nokia Lumia 928 WP8.10.14203.306

Posted 14 November 2013 - 19:10

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"



Best Answer Praetor , 14 November 2013 - 20:18

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
Go to the full post



#2 xendrome

xendrome

    In God We Trust; All Others We Monitor

  • Tech Issues Solved: 13
  • Joined: 05-December 01
  • OS: Windows 8.1 Pro x64

Posted 14 November 2013 - 19:13

http://www.krollontr.../powercontrols/ might be able to do it, but it's going to cost some cash



#3 OP Geoffrey B.

Geoffrey B.

    LittleNeutrino

  • Tech Issues Solved: 11
  • Joined: 25-July 05
  • Location: Ohio
  • OS: Windows 7 Ultimate
  • Phone: Nokia Lumia 928 WP8.10.14203.306

Posted 14 November 2013 - 19:59

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.



#4 +BudMan

BudMan

    Neowinian Senior

  • Tech Issues Solved: 106
  • Joined: 04-July 02
  • Location: Schaumburg, IL
  • OS: Win7, Vista, 2k3, 2k8, XP, Linux, FreeBSD, OSX, etc. etc.

Posted 14 November 2013 - 20:05

"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.word...-and-for-loops/

#5 OP Geoffrey B.

Geoffrey B.

    LittleNeutrino

  • Tech Issues Solved: 11
  • Joined: 25-July 05
  • Location: Ohio
  • OS: Windows 7 Ultimate
  • Phone: Nokia Lumia 928 WP8.10.14203.306

Posted 14 November 2013 - 20:13

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.



#6 Praetor

Praetor

    ASCii / ANSi Designer

  • Tech Issues Solved: 7
  • Joined: 05-June 02
  • Location: Lisbon
  • OS: Windows Eight dot One dot One 1!one

Posted 14 November 2013 - 20:18   Best Answer

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

Edited by Praetor, 14 November 2013 - 20:20.


#7 OP Geoffrey B.

Geoffrey B.

    LittleNeutrino

  • Tech Issues Solved: 11
  • Joined: 25-July 05
  • Location: Ohio
  • OS: Windows 7 Ultimate
  • Phone: Nokia Lumia 928 WP8.10.14203.306

Posted 14 November 2013 - 20:40

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.



#8 Praetor

Praetor

    ASCii / ANSi Designer

  • Tech Issues Solved: 7
  • Joined: 05-June 02
  • Location: Lisbon
  • OS: Windows Eight dot One dot One 1!one

Posted 14 November 2013 - 20:45

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.



#9 OP Geoffrey B.

Geoffrey B.

    LittleNeutrino

  • Tech Issues Solved: 11
  • Joined: 25-July 05
  • Location: Ohio
  • OS: Windows 7 Ultimate
  • Phone: Nokia Lumia 928 WP8.10.14203.306

Posted 19 November 2013 - 13:08

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.



#10 Praetor

Praetor

    ASCii / ANSi Designer

  • Tech Issues Solved: 7
  • Joined: 05-June 02
  • Location: Lisbon
  • OS: Windows Eight dot One dot One 1!one

Posted 20 November 2013 - 14:21

glad to help :)