Bulk export Mailbox to .PST using PowerShell
I recently received a request to bulk export mailboxes to .pst , to help mysef i have created this small script to import from csv and then kick off the export request.
file can be downloaded Here
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
#Created By: Shaun Hardneck #http://thatlazyadmin.com #Freebies :) Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn; Import-Csv 'C:\Softlib\Users.csv' | ForEach{ try { #Get-Mailbox -Identity $_.name | New-MailboxExportRequest -Mailbox $_.name -FilePath "\\auh2fs02\PST\$_.name.pst" -ErrorAction stop } catch [system.exception] { Write-Host "$_.name" -ForegroundColor Red } Finally { }} |
#ThatLazyAdmin
is there a way to export mailbox on 2010 to .csv file with mail header information also ? Inbox and Sent items ?
@ Arthur you can use the following command : New-MailboxExportRequest -Mailbox User1 -FilePath “\\SERVER01\PSTFileShare\User1.pst”