Sign in to follow this  
Followers 0
Geoffrey B.

[Req] Batch Export PST's from Exchange 2010

10 posts in this topic

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"

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

"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/

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

glad to help :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.