Max PST size limit is 20 GB, as this uses the Outlook provider. See http://support.microsoft.com/kb/830336/
- 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.
- Either Outlook 2003 or Outlook 2007 must be installed on the client machine.
- 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-Mailbox –Identity <mailboxUser> -PSTFolderPath <pathToSavePST>
PSTFolderPath must be a full path pointing either to a directory or to a (.pst) file. If a directory is specified a PST file named after the mailbox alias will be used as the target of the export. Note that if the PST file already exists the contents of the mailbox will be merged into it.
- To export multiple mailboxes to their respective .pst files at once you can pipe in the identities of those mailboxes to the export task. Notice that when bulk exporting the PSTFolderPath parameter must forcefully point to a directory since one .pst file will be created for each mailbox.
Get-Mailbox -Database 'MDB' | Export-Mailbox -PSTFolderPath D:\PSTs
- Just as with the export to PST scenario, when bulk importing mailboxes the PSTFolderPath must forcefully point to a directory and the task logic will try to match mailboxes alias with the .pst file names under that location. If no match is found for a particular mailbox, that mailbox will be skipped.
Get-Mailbox -Database 'MDB' | Import-Mailbox -PSTFolderPath D:\PSTs
Running a scheduled task is a two step process:
1) Create the powershell script and save it as a .ps1 file. E.g:
get-mailbox | export-mailbox -PSTFolderPath:'C:\' -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'"