The first thing I want to cover is Importing and Exporting PST files, I once carried out an exchange 2003 migration project, using exmerge to export pst files from 2003 and Exchange Management Shell (ESM) to import them. This approach only made sense as we were moving to a brand new domain in a new forest.
Requirements
In order to export or import mailboxes to PST files the following requirements must be met:
1) Export/Import to PST must be run from a 32 bit client machine with Exchange Management Tools installed Version Exchange 2007 SP1 or later. The 32bit requirement comes from a dependency with the Outlook client.
2) Either Outlook 2003 or Outlook 2007 must be installed on the client machine.
3) The user running the task must be an Exchange Organization Admin or an Exchange Server Admin on the server where the mailbox to export/import lives.
Export a mailbox to a PST File
Export-Mailbox -Identity ALIAS -PSTFolderpath C:\
This will export a PST file to the path specified and name that pst as the alias
Import is much the same
Import a mailbox to a PST File
Import-Mailbox -Identity ALIAS -PSTFolderpath C:\
To export all mailboxes to pst files the following commands are used
Get-Mailbox -Database MYDB Export-Mailbox -PSTFolderPath D:\PSTs
Mailboxes can also be exported to PST files via a scheduled task.
Running a scheduled task is a two step process:
1) Create the powershell script and save it as a .ps1 file.
get-mailbox | export-mailbox -PSTFolderPath C:\ -Confirm:$false
1b) OR
get-mailbox -server exchangemail -resultsize unlimited | export-mailbox -pstfolderpath Z:\ -baditemlimit 1000 -maxthreads 15 -confirm:$false
2) Create the scheduled task to run powershell and load the exchange snappin; then run your script. The action of your scheduled task should look like:
powershell.exe -PSConsoleFile “C:\Program Files\Microsoft\Exchange Server\Bin\ExShell.psc1″ -Command “. ‘C:\script.ps1′”
A common Exchange Administrator task might also be the extraction into a PST from a mailbox that is a Recovery Storage Group (RSG) for legal or compliance.
Exporting content directly from a RSG database to a PST file is not supported. To accomplish this task you’d have to first restore the mailbox content to an online mailbox using restore-mailbox and then export the online mailbox to a PST.
You could for example create a new mailbox to hold the recovered content and only grant access to it to the legal department; then export its contents to a PST file. To restore an RSG mailbox to a “different” mailbox you only need to use two additional parameters:
Restore-Mailbox -Identity legalDepartmentMailbox -RSGDatabase “Recovery Storage Group\My Database” -RSGMailbox mailboxToRecover -TargetFolder “Recovered Content”
You need to be a member of The SysAdmin Network to add comments!
Join The SysAdmin Network