2

I have been assigned a task to cleanup our Exchange server by exporting the mailboxes of users who have left the company. We want to keep a copy of the mailbox for 90 days, just in case HR or management needs it later. I have over 130+ mailboxes to export to complete this task.

I see that the only way to export a mailbox to a PST is to use Export-Mailbox cmdlet via the Exchange Management Tools. My question is this: Is there a script where I can do this en mass?? Perhaps past the email adresses into a file and run the script? This would be helpful and cut down the time it would take to complete this task.

Thanks in advance for any suggestions or help!!

Jake A
  • 454
  • 2
  • 10
  • 22
  • Yes, it's called Powershell. I don't feel like doing a "write my code for me for free" thing right now, but that's exactly what Powershell makes easy. I'd recommend checking out some of the learning Powershell guides out there. It'll make you hate using the GUI once you get good with it. – HopelessN00b Jul 30 '12 at 22:31
  • Same as @HopelessN00b I'm a bit busy but the short version is you need Exchange Management Tools (32-bit), Outlook (32-bit), Powershell 2.0 and the `export-mailbox` cmdlet. See: http://technet.microsoft.com/en-us/library/bb266964%28EXCHG.80%29.aspx – Mark Henderson Jul 30 '12 at 22:42

1 Answers1

2

Create a CSV with a single column of Exchange aliases. Add a header row at top with "Alias", and change the "E:\DriveForPST\ to point to a folder with enough space for all the pst's. I haven't tested this as I'm on Ex2010 and Export-Mailbox is a 2007 command.

Import-Csv “C:\Users.CSV” | ForEach-Object {
   $PSTPath = "E:\DriveForPST\" + $_.Alias + ".pst"
   Export-Mailbox -Identity $_.Alias -PSTFolderPath $PSTPath
 }

More help here:

Export-Mailbox: http://technet.microsoft.com/en-us/library/bb266964(v=exchg.80).aspx

Import-CSV: http://technet.microsoft.com/en-us/library/dd347665.aspx

Bret Fisher
  • 3,973
  • 2
  • 21
  • 25